Commit Graph

23 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
Johannes Scheuermann 999aec1252
Resolve the epoch seconds for expiredEndVersion and unreliableEndVersion (#13690) 2026-07-14 10:41:02 +02: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 287efc8530 Rename key-backed coroutine headers 2026-05-11 07:47:09 -07:00
Trevor Clinkenbeard a8412cbda3 Remove outdated comments 2026-05-08 17:22:40 -07:00
Trevor Clinkenbeard e94cfd7b19 Fix include cleanup formatting 2026-05-08 12:34:36 -07:00
Trevor Clinkenbeard eed2bd7d2b Use IWYU to remove additional unused includes 2026-05-08 10:19:58 -07:00
Trevor Clinkenbeard b4933e5a48 Remove unused includes from core implementation files 2026-05-07 13:31:01 -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 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 bf00cbf1c0 Rename *.actor.* files 2026-04-12 22:41:05 +00:00
Trevor Clinkenbeard b700f9a0df Remove AsyncTaskThread 2026-03-26 16:53:30 -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
Trevor Clinkenbeard e07ac68621 Rename BackupAgentBase.actor.cpp and BackupAgent.actor.h 2026-03-23 12:51:37 +00:00
Trevor Clinkenbeard 695526aa48 Rename non-actor files 2026-03-22 03:06:37 +00:00
Trevor Clinkenbeard 5e88b64e60 Merge remote-tracking branch 'origin/main' into dev/tclinkenbeard/backup-file-system-coro 2026-03-21 13:01:24 -07:00
Trevor Clinkenbeard 4598fd75e8 Rename BackupContainer.actor.cpp 2026-03-21 00:43:48 +00:00