Commit Graph

16 Commits

Author SHA1 Message Date
Trevor Clinkenbeard b4bed50133 Trim another IWYU-backed include batch 2026-05-08 12:17:36 -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
Jingyu Zhou 2d2a2144f4
Update copyright years to 2013-2026 (#12653)
No functional changes.
2026-01-22 10:49:41 -08:00
Michael Stack 564e95b681
Integrate BulkDump/BulkLoad with backup/restore system (#12608)
* Integrate BulkDump/BulkLoad with backup/restore system

This commit adds the ability to use BulkDump for creating backup snapshots
and BulkLoad for restoring them, providing faster backup/restore operations
for large databases.

Key changes:
- Add BulkDumpTaskFunc to create SST file snapshots during backup
- Add BulkLoadRestoreTaskFunc to restore from BulkDump snapshots
- Store bulkDumpJobId in snapshot metadata for restore coordination
- Add snapshotMode parameter (0=RANGEFILE, 1=BULKDUMP) to control backup type
- Add useRangeFileRestore parameter to control restore method
- Add CLIENT_KNOBS for configurable job timeouts
- Add test assertions to verify BulkDump/BulkLoad execution
- Check for existing running jobs to avoid conflicts when multiple agents run
- Properly scope state variables for error handling in Flow actors

New test: tests/slow/BackupS3BlobBulkLoadRestore.toml

* Update design/bulkload-restore-integration.md
2026-01-21 21:29:23 -08:00
Zhe Wang 9d48416832
BulkLoad a Range (#12252)
* enable bulkload a range

* nits
2025-07-31 15:34:38 -07:00
Zhe Wang 0e736c68e7
Allow One BulkloadTask Do Multiple Manifests (#12036) 2025-03-17 11:45:15 -07:00
Zhe Wang 6ae46b4917
BulkLoadJob Should Not Schedule Completed BulkLoadTask (#12030)
* make bulkload job manager logic clear

* bypass task if the task has been completed

* improve scheduleBulkLoadJob
2025-03-14 14:52:33 -07:00
Zhe Wang 10fecd0a4e
Add Error Message To BulkLoadJob Metadata (#12024)
* add error message to bulkload metadata

* remove TODOs and add error message for bulkload job manifest map creation failures

* nits
2025-03-13 10:02:39 -07:00
Zhe Wang 79a38c1dc0
Fix RangeLock in BulkDump Test and Avoid Memory Copy For Async Read/Write Bulk Files (#12007) 2025-03-10 15:13:29 -07:00
Zhe Wang 8142ebd029
Add BulkLoad History (#11992)
* add bulkload history

* address comments

* address comments
2025-03-04 18:50:08 -08:00
Michael Stack ff22876247
Add multiparting to s3client. (#11920)
* Add multiparting to s3client.
Fix boost::urls::parse_uri 's dislike of credentialed blobstore urls.

* fdbclient/BulkLoading.cpp
 Add blobstore regex to extract credentials before feeding the boost
 parse_uri.

* fdbclient/include/fdbclient/S3BlobStore.h
* fdbclient/S3BlobStore.actor.cpp
 Add cleanup of failed multipart -- abortMultiPartUpload l(s3 will do
 this in the background eventually but lets clean up after ourselves).
 Also add  getObjectRangeMD5 so can do multipart checksumming.

* fdbclient/S3Client.actor.cpp
 Change upload file and download file to do multipart always.
 Retry too.

* fdbclient/S3Client_cli.actor.cpp
 Add command line to trace rather than output.

* Address Zhe review

* More logging around part upload and download

* Undo assert that proved incorrect; restore the old length math
doing copy in readObject.

Cleanup around TraceEvents in HTTTP.actor.

* Undo commented out cleanup -- for debugging

* formatting

---------

Co-authored-by: stack <stack@duboce.com>
2025-02-13 09:06:17 -08:00
Zhe Wang 0f6fa090ce
Bulkload Engine Support General Storage Engine and Fix BulkLoad Bugs (#11898)
* bulkload support general engine and fix bugs

* add comments

* improve test coverage and fix bug

* nits and address comments

* nit

* nits

* fix data inconsistency bug due to bulkload metadata

* fix ss bulkload task metadata bugs

* nit and fix CI issue

* fix bugs of restore ss bulkload metadata

* use ssBulkLoadMetadata for fetchKey and general kv engine

* cleanup bulkload file for fetchkey

* fix CI issue

* fix simulation stuck due to repeated re-recruitment of unfit dd

* randomly do available space check when finding the dest team for bulkload in simulation

* address conflict

* code clean up

* update BulkDumping.toml same to BulkLoading.toml

* consolidate ss fetchkey and fetchshard failed to read bulkload task metadata

* fix DD bulkload job busy loop bug which causes segfault and test terminate unexpectedly in joshua test

* nit

* fix ss busy loop for bulkload in fetchkey

* use sqlite for bulkload ctest

* fix bulkload ctest stuck issue due to merge and change storage engine to ssd

* fix comments for CC recruit DD

* address comments

* address comments

* add comments

* fix ci format issue

* address comments

* add comments
2025-02-06 12:04:13 -08:00
michael stack aea37ae90d Use s3 if available when running the bulkload test.
It was disabled until we made it so the SS could
talk to s3, included in this PR.

Also finished the bulkload test. It only had the
bulkdump portion. bulkload support was recentlty
added so finish off the test here by adding bulkload
of the bulkdump and then verifying all data present.

Added passing knobs to the fdb cluster so available to the
fdbserver when it goes to talk to s3. Also added passing
SS count to start in fdb cluster.

* fdbclient/tests/fdb_cluster_fixture.sh
 Add ability to pass multiple knobs to fdb cluster
 and to specify more than just one SS.

* fdbserver/fdbserver.actor.cpp
 Add --blob-server option and processing of FDB_BLOB_CREDENTIALS
 if present (hijacked the unused, unadvertised --
   blob-credentials-file).

* tests/loopback_cluster/run_custom_cluster.sh
 Allow passing more than just one knob.

* fdbclient/BulkLoading.cpp
* fdbclient/include/fdbclient/BulkLoading.h
 Added getPath

* fdbclient/S3BlobStore.actor.cpp
 Fix bug where we were doubling up the first '/' on a path if
 it had a root '/' already (s3 treats /a/b as distinct from
 /a//b).

* fdbclient/S3Client.actor.cpp
 Fix up of traceevent Types.

* fdbclient/tests/bulkload_test.sh
 Enable being able to use s3 if available.
 Pick up jobid when bulkdumping. Feed it to new bulkload
 method. Add verification all data present post-bulkload.

* fdbserver/BulkLoadUtil.actor.cpp
 Add support for blobstore.

* tests/loopback_cluster/run_custom_cluster.sh
 Bug fix -- we were only able to pass in one knob. Allow
 passing multiple.
2025-01-17 17:29:56 -08:00
Zhe Wang cf7c8f41b2
BulkLoad Job Framework and Co-Testing BulkLoad and BulkDump (#11865)
* add bulkload job framework and fix bugs

* add BulkLoadChecksum, fix CI issue

* nits

* nits

* address comments

* mitigate perpetual wiggle to make sure DD can select a valid team to inject data

* fix submitBulkDumpJob and submitBulkLoadJob

* change remoteRoot to jobRoot

* add comments
2025-01-14 11:28:42 -08:00
Zhe Wang d3532e4478
Improve BulkLoad/Dump implementation (#11842)
* Improve BulkLoad/Dump implementation

* make bulkload test data folder inside simfdb folder

* simplify code

* use manifest in bulkdump metadata

* use manifest in bulkload

* apply bulkload fileset to bulkload and fix bugs of bytesampling value generation

* remove BulkDumpFileFullPathSet

* address comments

* address comments

* address comments
2025-01-06 13:02:23 -08:00
Zhe Wang 74990e44bd
Bulk Loading Framework (#11369) 2024-07-23 14:57:28 -07:00