Commit Graph

55 Commits

Author SHA1 Message Date
Trevor Clinkenbeard a42a354b0d Adjust code probe rarity to match simulation coverage 2026-07-22 10:28:11 -07:00
Trevor Clinkenbeard 15df0ae8fc Remove unused FoundationDB helpers 2026-07-17 19:49:29 -07:00
Trevor Clinkenbeard d523d509a7 Enable additional clang-tidy correctness checks 2026-07-15 22:00:36 -07:00
Trevor Clinkenbeard def6ef6cc0 Merge remote-tracking branch 'origin/main' into dev/tclinkenbeard/custom-clang-tidy-fixes 2026-07-14 20:32:17 -07:00
Trevor Clinkenbeard 5d6c4e8068 Correct stale FoundationDB code probes 2026-07-14 11:32:11 -07:00
Trevor Clinkenbeard 20f2b59b41 Add braces to actor cancellation checks 2026-07-12 10:11:40 -07:00
Trevor Clinkenbeard 4662fea92f Fix issues found by custom clang-tidy checks 2026-07-12 09:50:35 -07:00
Trevor Clinkenbeard d8fef50ea2
Merge pull request #13380 from tclinkenbeard-oai/dev/tclinkenbeard/split-management-api-status-rangelock
Split `StatusSchema` and `RangeLock` from `ManagementAPI`
2026-07-07 19:58:22 -07:00
Trevor Clinkenbeard 0d58632bcc Merge remote-tracking branch 'origin/main' into dev/tclinkenbeard/split-management-api-status-rangelock
# Conflicts:
#	fdbclient/ManagementAPI.cpp
2026-07-07 16:45:03 -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
Trevor Clinkenbeard 8d18f51d23 Split StatusSchema and RangeLock from ManagementAPI 2026-06-22 20:45:02 -07:00
Michael Stack 9b5dda16ce
backup/restore: operator UX cleanups for CLI flags and status output (#13345)
Four small, independent changes surfaced while running a manual
backup/restore demo end to end:

- fdbrestore now accepts -C and --cluster-file as aliases for
  --dest-cluster-file. Every other tool (fdbcli, fdbbackup, fdbserver,
  backup_agent) already pairs -C with --cluster-file; fdbrestore was
  the lone outlier and forced scripts to special-case it.

- fdbcli now accepts --logdir as an alias for --log-dir. Every other
  tool spells the flag --logdir (no hyphen); the --log-dir form in
  fdbcli was the outlier here.

- fdbbackup status no longer prints "BulkLoad Compatible: no" when
  Snapshot Mode is rangefile. In that mode the answer is tautologically
  derivable from the line above it (no bulkdump task ever runs), so
  the line carries no information. The field still prints in modes
  bulkdump and both, where it can flip during an in-progress backup.

- Correct the misleading comment in FileBackupAgent.cpp that claimed
  submitBulkLoadJob validates cluster preconditions server-side. It
  does not. A bulkload restore against a cluster missing
  shard_encode_location_metadata / enable_read_lock_on_range, or with
  a storage engine that cannot ingest SSTs, succeeds at submission and
  then silently stalls in "State: running, Tasks: 0/0" forever. Replace
  the comment with a faithful description of the failure mode and add
  a matching TODO in submitBulkLoadJob explaining where the real
  validation needs to live (somewhere with cluster-side knob
  visibility) and why it cannot be done from fdbclient.
2026-06-12 07:54:47 -07:00
Michael Stack 1c0bdc4bf1
Allow bulkload restore into a non-empty destination database (#13340)
submitParallelRestore enforced an empty-destination precheck for all
restore modes by reading the first row of each target range. This is
correct for rangefile restore but wrong for bulkload: bulkload owns
the target range via an exclusive range lock and the storage server
clears each shard before SST ingestion, so a non-empty destination is
expected. Gate the precheck on useRangeFileRestore so bulkload skips
it.

Without this fix, "fdbrestore start --mode bulkload" against a cluster
with existing data fails with restore_destination_not_empty (2370).
The previous workaround was a manual clearrange before invoking
restore, which at large scale (>=4TB) overwhelms storage servers with
tombstones and stalls the cluster for hours.

Also document the per-shard clear-then-ingest sequence in bulkload.rst
and clarify in bulkload-user.rst that the clearrange in the quickstart
example is illustrative, not required.

Validated end-to-end at 100M scale (2026-06-04): bulkload from S3,
backup, rangefile baseline restore into validation prefix, bulkload
main restore into normal keyspace, marker-key data verification all
passed.
2026-06-11 10:54:34 -07:00
Akanksha Mahajan 3c247e928a
Coordinate BackupAgent and DataDistributor to compute partitions for range-partitioned backup (V3) (#13304)
* Implementation

* Add knob

* Addressed comments

* Addressed comments to move clearing the key in checkAndDisableRangeBackupWorkers
2026-06-03 08:30:26 -07:00
Akanksha Mahajan 88a04b2eb5
Complete some of function Implementation in BackupWorker V3 (#13245)
* Initialize LogSystem before PartitionMap can be pulled from TLOG

* Remove allWorkerStarted logic

* Fix clang tidy errors

* Simplify the code

* Additional fixes

* Removed unused variables from BackupWorker

* Addressed comments

* Addressed comments
2026-05-30 12:13:45 -07:00
Trevor Clinkenbeard 09b654dd33 Apply clang-format to inline buggify changes 2026-05-28 07:44:20 -07:00
Trevor Clinkenbeard b46c58415c Replace BUGGIFY macros with inline function 2026-05-20 14:54:51 -07:00
Trevor Clinkenbeard ed576c36d8
Merge pull request #13195 from tclinkenbeard-oai/dev/tclinkenbeard/key-backed-header-rename
Rename key-backed coroutine headers
2026-05-11 09:11:04 -07:00
neethuhaneesha 2633ed5793
Adding range_backup_worker_enabled to DB config for recruiting range partitioned backup workers. (#13169) 2026-05-11 08:32:09 -07:00
Trevor Clinkenbeard 287efc8530 Rename key-backed coroutine headers 2026-05-11 07:47:09 -07:00
Trevor Clinkenbeard 191a0c4b4d Merge remote-tracking branch 'origin/main' into dev/tclinkenbeard/explicit-ctors 2026-05-07 08:38:39 -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 af2a5f60f4
Add mutation-log-type conflict check in submitBackup (#13143) 2026-05-05 09:20:13 -07:00
Michael Stack a0e311e02b
Revamp fdbbackup/fdbrestore status messages (bulkload/bulkdump) (#13120)
* Revamp fdbbackup/fdbrestore status messages (accomodate bulkload/bulkdump)

BEFORE (old output):

fdbbackup status:
Snapshot Mode: both
BulkLoad Compatible: no
BulkDump progress:
 Tasks completed - 35546 / 35633 (99.8%)
 Bytes completed - 3081282401872 (2.80 TB) / 3081282401785 (2.80 TB)
 Throughput - 600.9 MB/s
 Elapsed time - 1 hours 21 minutes
Snapshot interval is 864000 seconds.  The initial snapshot is still running.
Details:
 LogBytes written - 0
 RangeBytes written - 4128760861276
 Last complete log version and timestamp        - 224414452771, 2026/04/27.17:14:19+0000
 Last complete snapshot version and timestamp   - 221170099677, 2026/04/27.16:20:15+0000
 Current Snapshot start version and timestamp   - 221175893391, 2026/04/27.16:20:21+0000
 Expected snapshot end version and timestamp    - 1085175893391, 2026/05/07.16:20:20+0000

fdbrestore status:
Tag: backup_4tb  UID: abc123  State: running  Blocks: 500/2000  BlocksInProgress: 1500  Submitted: 100  Triggered: 50  Running: 5  TotalTasks: 100  Files: 42  BytesWritten: 4123456789  ApplyVersionLag: 5000000  LastError: None

AFTER (new output):

fdbbackup status:
Snapshot Mode: both
BulkLoad Compatible: yes
BulkDump Snapshot:
 Tasks: 35546/35633 complete (99.8%)
 Bytes: 2.80 TB / 2.80 TB
 Throughput: 600.9 MB/s
 Elapsed: 1 hours 21 minutes
Rangefile Snapshot:
 Bytes written: 4.1 TB
 Status: Initial snapshot still running
 Started: 2026/04/27.16:20:21+0000
Mutation Logs:
 Bytes written: 0
 Last complete version: 224414452771 (2026/04/27.17:14:19+0000)
Snapshot interval is 864000 seconds.

fdbrestore status (mode=rangefile):
Tag: backup_4tb  UID: abc123  State: running
 Blocks: 500/2000 complete
 Files: 42
 Bytes written: 4.1 TB
 Apply version lag: 5000000

fdbrestore status (mode=bulkload):
Tag: backup_4tb  UID: abc123  State: running
 Tasks submitted: 100  triggered: 50  running: 5
 Tasks complete: 50 / 100 total
 Bytes written: 2.1 TB
 Avg bytes/task: 21 MB

* Formatting

* Fix restore status output: correct label, avg calc, backward compat, unused var
2026-05-04 23:02:11 -07:00
neethuhaneesha 1de02c28c5
Adding mutation log type configuration to backup. (#13123) 2026-05-04 13:32:11 -07:00
Trevor Clinkenbeard 2edff49627 Merge remote-tracking branch 'origin/main' into dev/tclinkenbeard/explicit-ctors
# Conflicts:
#	fdbrpc/include/fdbrpc/AsyncFileEncrypted.h
#	fdbserver/include/fdbserver/KmsConnector.h
#	fdbserver/workloads/DifferentClustersSameRV.cpp
#	flow/include/flow/TxnCounters.h
2026-05-02 15:01: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
Trevor Clinkenbeard 92de2c1691 Remove small unused helpers 2026-04-28 06:56:29 -07: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 399d13505f Make single-argument constructors explicit 2026-04-24 18:53:40 +00:00
Trevor Clinkenbeard c127105f57 Improve header file encapsulation 2026-04-24 16:03:07 +00:00
Trevor Clinkenbeard e38baf18ea Fix more clang-tidy warnings 2026-04-15 14:23:33 +00:00
Trevor Clinkenbeard 8cf846d7d6 Merge remote-tracking branch 'origin/main' into dev/tclinkenbeard/fdbclient-encapsulation 2026-04-01 21:37:48 -07:00
gxglass bca167fe96
Remove parallel restore feature (#12903)
This parallel restore feature has been slated for removal for at least a year. This PR is closely based on earlier PR #12107.

This blog post explains some of the problems with the parallel restore feature: https://medium.com/@jingyuzhou/why-foundationdb-restore-is-slow-and-what-can-be-done-about-it-e73a821fdd33

As far as large feature removal changes go, this one is very straightforward, with most relevant files and test cases simply being deleted. There is one knob rename where storageserver.actor.cpp was using a knob with FASTRESTORE in the name. Other than that, changes to shared files mainly involve removing fastrestore-specific CLI and role support.

In progress:
20260330-222511-gglass-5ee0142213471b70 compressed=True data_size=35343375 duration=4611964 ended=100000 fail=1 fail_fast=1000 max_runs=100000 pass=99999 priority=100 remaining=0 runtime=0:58:23 sanity=False started=100000 stopped=20260330-232334 submitted=20260330-222511 timeout=5400 username=gglass

The one failure was in SwizzledCycleTest.toml with too many lines of output and a timeout. I kind of suspect it's unrelated but haven't looked further.
* Remove parallel restore feature.  This is based on earlier PR 12107.  Compiles but untested.

* AI generated commit:

⏺ The fix restores a single if block that was accidentally deleted when removing the FASTRESTORE_TOOL code:

  if (!restoreSystemKeys && !restoreUserKeys && backupKeys.empty()) {
      addDefaultBackupRanges(backupKeys);
  }

  When no explicit key ranges are specified on the command line and neither --user-data nor --system-metadata flags are set, this populates backupKeys with the default backup ranges
  (essentially all user data). Without it, backupKeys stays empty and hits the ASSERT(!backupRanges.empty()) in submitBackup().

* Remove a believed-to-be-dead code path, and update .gitignore

* Remove duplicate definition of restoreRequestDoneKey
2026-04-01 15:57:12 -07:00
Trevor Clinkenbeard 45da11c439 Make fdbclient header files private 2026-04-01 07:47:51 +00:00
Trevor Clinkenbeard 5cf4b48319 Rename ManagementAPI* files 2026-03-24 16:13:35 +00:00
Trevor Clinkenbeard e07ac68621 Rename BackupAgentBase.actor.cpp and BackupAgent.actor.h 2026-03-23 12:51:37 +00:00
Trevor Clinkenbeard a6dd5da380 Merge remote-tracking branch 'origin/main' into dev/tclinkenbeard/expand-make-reference3 2026-03-19 11:17:17 -07:00
Michael Stack 1f75fbe25b
Improve backup/restore observability and status messages (#12729)
* Add BulkDump/BulkLoad observability for backup/restore progress tracking

Progress tracking APIs:
- getBulkDumpProgress() / getBulkLoadProgress() - track tasks, bytes, throughput, ETA
- getBulkDumpOwner() - track job ownership (e.g., which backup owns a bulkdump)
- Owner registration system for backup agents

CLI improvements:
- 'bulkdump status' and 'bulkload status' commands with human-readable output
- Progress display with throughput and ETA

Backup agent integration:
- Register backup as owner of bulkdump jobs
- Show bulkdump/bulkload progress in backup status output

Utility functions (flow/Util.h):
- formatBytesHumanReadable() - "1.23 TB", "456 MB"
- formatDurationHumanReadable() - "2 hours 30 minutes"
- formatBytesProgress(), formatThroughputLine(), formatETALine()

Test coverage:
- verifyBulkDumpObservability() / verifyBulkLoadObservability() in BackupS3BlobCorrectness

Bug fixes:
- Fix format string mismatch crash in FileBackupAgent progress display
- Add empty result guards for krmGetRanges() calls to prevent size_t underflow

* Formatting

* Rebase and formatting

* * cmake/CompileRocksDB.cmake
 Preserve version when find_packge doesn't turn up rocksdb version

* fdbbackup/tests/backup_tests_common.sh
 Wait when mode is 'both' for snapshot to be written.

* fdbclient/BulkLoading.cpp
 Remove extra '/'.

* Output time of bulkload in bulkload history fdcli output as iso8601 instead of seconds since epoch

* Print start time as iso8601 -- readable -- instead of seconds since epoch -- unreadable... And don't crash if not a UUID

* Remove cute graphics.. and bullet characters

* Throw exception if not able to parse backup 'mode'
2026-03-18 21:10:28 -07:00
Trevor Clinkenbeard 55a6d7eb55
Simplify loop variable initialization (#12804) 2026-03-18 15:38:14 -07:00
Trevor Clinkenbeard a3d39697e7 Expand use of makeReference 2026-03-18 09:15:56 -07:00
Trevor Clinkenbeard 1306c2f5a9 Remove unnecessary success calls 2026-03-18 09:00:46 -07:00
Trevor Clinkenbeard bab8dca1fa Remove unnecessary calls to store coroutine 2026-03-18 08:26:43 -07:00
Trevor Clinkenbeard 282b9fe10b
Merge branch 'main' into dev/tclinkenbeard/modernize-clang-tidy 2026-03-14 19:15:25 -07:00
Trevor Clinkenbeard e7737f7bf6 Enforce new rules 2026-03-14 02:25:26 +00:00
Trevor Clinkenbeard df9d45b009 Fix formatting 2026-03-13 19:19:27 -07:00