Commit Graph

30 Commits

Author SHA1 Message Date
Akanksha Mahajan 96f56bb29a
Fix read-side overflow and simplify append API for large snapshot manifests (#13691)
* Fix read-side overflow and simplify append API for large snapshot manifests

  Follow-up to #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
2026-07-20 12:39:15 -07:00
Trevor Clinkenbeard d523d509a7 Enable additional clang-tidy correctness checks 2026-07-15 22:00:36 -07:00
Trevor Clinkenbeard cd294fdfaa Use fmt::format in encrypted backup regression test 2026-07-12 22:41:43 -07:00
Trevor Clinkenbeard cd7890a735 Fix encrypted backup restore block-size initialization 2026-07-12 22:22:29 -07:00
Johannes Scheuermann 4c775a91e8
Add note to fdbbackup expire if expire version got adjusted. (#13664)
expireData() can silently roll the expiration point back to a log file begin version when the requested version falls in the middle of that log file, since a log file cannot be partially deleted.
The CLI always printed the originally requested version regardless, making it look like more data was deleted than actually was.
ExpireProgress now tracks both the requested and actual end version so the CLI can print a note when they differ, in either direction (rolled back, or already expired past the request).
2026-07-10 09:52:46 +02:00
Akanksha Mahajan e1edb57472
Add GCM Authentication Tag to Encrypted Backup Files 2026-07-09 09:26:39 -07:00
Trevor Clinkenbeard 405d0006f3 Merge remote-tracking branch 'origin/main' into dev/tclinkenbeard/split-file-backup-agent
# Conflicts:
#	fdbclient/include/fdbclient/BackupAgent.h
2026-07-07 16:44:46 -07:00
Akanksha Mahajan f6a0557f3a
Rename Range Partitioned to consisent name (#13386) 2026-07-03 11:02:24 -07:00
Trevor Clinkenbeard e12537f324 Extract backup file format from FileBackupAgent 2026-06-23 09:14:30 -07:00
Trevor Clinkenbeard fe42e6fd79 Enforce clang-tidy braces around long statements 2026-06-22 23:01:11 -07:00
Johannes Scheuermann 9bb7086ac5
Fix overflow bug for large json documents in writeKeyspaceSnapshotFile (#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
2026-06-18 11:35:19 +02:00
Trevor Clinkenbeard c15b88ff7d Merge remote-tracking branch 'origin/main' into dev/tclinkenbeard/inline-buggify-function
# Conflicts:
#	fdbserver/core/ServerKnobs.cpp
#	fdbserver/tlog/TLogServer.cpp
2026-05-28 07:29:13 -07:00
Trevor Clinkenbeard 091aa15a2f Address clang-tidy warnings 2026-05-24 18:14:26 -07:00
Trevor Clinkenbeard 1bc151d47f Add more clang-tidy checks 2026-05-24 15:15:47 -07:00
Trevor Clinkenbeard b46c58415c Replace BUGGIFY macros with inline function 2026-05-20 14:54:51 -07:00
Akanksha Mahajan 921466eeaf
Remove unused code from backup (#13155) 2026-05-07 10:22:16 -07:00
Akanksha Mahajan 9ec2b21a80
Encryption backward compatibility changes and formatting (#13129)
* Encryption changes

* Addressed comments
2026-05-05 21:33:52 -07:00
neethuhaneesha 1de02c28c5
Adding mutation log type configuration to backup. (#13123) 2026-05-04 13:32:11 -07:00
Akanksha Mahajan a825567220
Fix unit test failure (#13134) 2026-05-01 17:54:26 -07:00
Akanksha Mahajan 54795dcc94
Design changes to pass encryption_block_size to fdbbackup command and remove knob (#13023) 2026-04-30 13:32:14 -07:00
Trevor Clinkenbeard 10c495edf0
Merge pull request #13075 from tclinkenbeard-oai/dev/tclinkenbeard/grey-failure-detection
Improve header file encapsulation
2026-04-28 14:45:23 -05:00
Michael Stack 615f79c774
Improve backup/restore/bulkload observability and reliability (#13047)
* Improve backup/restore/bulkload observability and reliability

Restore progress tracking:
- Add sub-phase counts (Submitted/Triggered/Running/TotalTasks) to
  fdbrestore status output so users can see task submission progress
- Add getBulkLoadTaskProgress() to scan task states during restore
- Replace monitorBulkLoadJobCompletion with progress-tracking variant
  that updates RestoreConfig counters every 5 seconds

Backup mode=BOTH fixes:
- Set bulkDumpJobId on BackupConfig so status shows BulkLoad Compatible
- Add bulkDumpSnapshotEndVersion for proper getLatestRestorableVersion
- Fix firstSnapshotEndVersion: only set from rangefile in mode=BOTH
- Skip empty BulkDump snapshots (totalSize=0) in rangefile restore

BulkLoad restore reliability:
- Abort restore immediately when no bulkdump data found (not retry forever)
- Add monitorBulkLoadModeAndSpawnActors so DD picks up bulkload jobs
  submitted after DD initialization (required for restore workflow)

Audit validate_restore fixes:
- Read source data via database transaction instead of local SS to
  avoid missing keys at shard boundaries after bulkload restore
- Add fast-path detection for completely empty baseline or source
- Retry on server_overloaded errors during audit
- Add AUDIT_RESTORE_BATCH_KEY_LIMIT and AUDIT_PROGRESS_PERSIST_BYTES_INTERVAL
  knobs for tuning audit performance

CLI cleanup:
- Combine redundant task lines in bulkload/bulkdump status output
- Remove misleading health score and optimization recommendations
- Raise bulk task stall threshold from 60s to 600s (SST downloads
  from blobstore routinely take 5-10 minutes)

* Address PR review: incrementalBackup check for mode=BOTH, snapshot type label, retry logging

- Add incrementalBackup fallback in getLatestRestorableVersion for mode==2
  (was missing unlike modes 0 and 1)
- Note snapshot type heuristic as imperfect in describe output
- Log retries in getBulkLoadTaskProgress

* Parse snapshot type from filename instead of inferring from heuristic

KeyspaceSnapshotFile now has a snapshotType field parsed from the
snapshot filename (format: snapshot,begin,end,size,type). The type
suffix was already written but discarded during parsing. Now captured
and used for reliable bulkdump vs rangefile identification in
fdbbackup describe output.

* Simplify getBulkLoadTaskProgress: always set LOCK_AWARE, drop lockAware parameter

* Use Transaction instead of ReadYourWritesTransaction in getBulkLoadTaskProgress

Read-only function does not need write tracking overhead.
Uses Transaction* overload of krmGetRanges.
2026-04-24 13:45:38 -07:00
Trevor Clinkenbeard c127105f57 Improve header file encapsulation 2026-04-24 16:03:07 +00:00
Arnav Aggarwal ea921e6420
Introduce blob store interface and refactor S3 classes (#12936)
* Refactor blob store classes to use interface

* update to make some methods non-pure virtual

* Complete IBlobStoreEndpoint interface refactoring

Move doRequest, connect, returnConnection, updateSecret, writeEntireFile,
listObjects, and deleteRecursively from S3BlobStoreEndpoint to the shared
IBlobStoreEndpoint base class. Introduce provider hook methods
(setRequestHeaders, normalizeResourceForRequest, simulateRequestFailure,
processRequestFailure, preRetryCheck, extractCredentialFields) so that
the request loop is provider-agnostic.

Rename s3_backup_test.sh to backup_restore_test.sh and update CMake
to reflect the provider-agnostic naming.

Fix double proxy absolute-form rewrite bug where both
S3BlobStoreEndpoint::normalizeResourceForRequest and the base doRequest
would prepend http://host:port for proxy connections.

Fix getResourceURL duplication by having S3's override delegate to the
base class for shared knob-params/extra-headers logic.

* resolve review comments

* remove gcs auto region block

* clang format

* Enable +x bit.

* clang tidy
2026-04-17 09:17:15 -07:00
Trevor Clinkenbeard 38b05e51cd Post coroutine conversion linting 2026-03-25 16:31:16 -07:00
Trevor Clinkenbeard 9b8d3702ac Merge remote-tracking branch 'origin/main' into dev/tclinkenbeard/backup-agent-base-coro 2026-03-23 13:33:20 -07:00
Akanksha Mahajan 061e49299b
Save Mutations in Range Partitioned Log Files for Backup V3 (#12752)
* Upload data to files

* Addressed comments

* Add some comments as TODO

* Fix some errors

* Update according to coroutine
2026-03-23 10:59:08 -07:00
Trevor Clinkenbeard e07ac68621 Rename BackupAgentBase.actor.cpp and BackupAgent.actor.h 2026-03-23 12:51:37 +00:00
Trevor Clinkenbeard 54854c3cdb Work around gcc coroutine bug 2026-03-20 23:40:02 +00:00
Trevor Clinkenbeard 66978d18f1 Rename BackupContainerFileSystem.actor.cpp 2026-03-20 23:34:31 +00:00