Repository navigation
Fix read and write side overflow for large snapshot manifests for Backup and Restore - #13820
Merged
akankshamahajan15 merged 3 commits intoAug 7, 2026
Merged
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
apple#13349) * Fix overflow bug for large json documents in writeKeyspaceSnapshotFile * Move chunked append into non-virtual overload to fix the same overflow issue for all append calls and add additional test case
akankshamahajan15
force-pushed
the
release-7.4.port
branch
from
August 7, 2026 18:31
91ee009 to
0d04b9a
Compare
akankshamahajan15
marked this pull request as ready for review
August 7, 2026 18:41
spraza
previously approved these changes
Aug 7, 2026
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
…ifests (apple#13691) * Fix read-side overflow and simplify append API for large snapshot manifests Follow-up to apple#13349, which fixed the write-side overflow when a snapshot manifest exceeds ~2 GB but left the read side and the API untidy. This PR addresses both. ### Changes **Simpler append API** There were two `append()` methods — one taking `int`, one `size_t` — and which ran depended on the argument type, which is easy to get wrong. Replaced with a single public `append()` that safely chunks any size, plus a clearly-named backend hook `appendImpl()` that each storage backend implements. No more overload ambiguity. **Read side fix** `readKeyspaceSnapshot` read the manifest into a buffer whose length is an `int`, so a manifest larger than 2 GB could truncate and crash on restore. It now reads into a `std::string` (which can exceed 2 GB) in chunks, matching the write side, and drops a redundant full copy of the manifest. **Knob rename** `BACKUP_MANIFEST_WRITE_CHUNK_SIZE` → `BACKUP_MANIFEST_CHUNK_SIZE`, since it now controls chunk size for both reads and writes. **Test** Added a unit test that reads a manifest back in many small chunks and verifies all range files and key ranges round-trip correctly. ### Notes - Range and log files are unaffected — they're already streamed in small blocks on both read and write. * Addressed comments * Fix clang tidy errors
akankshamahajan15
force-pushed
the
release-7.4.port
branch
from
August 7, 2026 19:38
19dc9d3 to
b9b540c
Compare
This comment has been minimized.
This comment has been minimized.
neethuhaneesha
approved these changes
Aug 7, 2026
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Contributor
Result of foundationdb-pr-clang-arm on Linux RHEL 9
|
This comment has been minimized.
This comment has been minimized.
Contributor
Result of foundationdb-pr-macos-m1 on macOS 14.x
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Contributor
Result of foundationdb-pr-clang on Linux RHEL 9
|
Contributor
Result of foundationdb-pr on Linux RHEL 9
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Contributor
Result of foundationdb-pr-cluster-tests on Linux RHEL 9
|
spraza
approved these changes
Aug 7, 2026
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Contributor
Result of foundationdb-pr-macos on macOS 14.x
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cherrypicked:
#13349 Fix overflow bug for large json documents in writeKeyspaceSnapshotFile
#13691 Fix read-side overflow and simplify append API for large snapshot manifests
100k completed
20260807-174026-ak_bk7.4-4ef0a8cfd3888796 compressed=True data_size=41358864 duration=3716394 ended=100000 fail_fast=10 max_runs=100000 pass=100000 priority=100 remaining=0 runtime=0:47:41 sanity=False started=100000 stopped=20260807-182807 submitted=20260807-174026 timeout=5400 username=ak_bk7.4