Commit Graph

234 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 cbb0b5725e Merge remote-tracking branch 'origin/main' into dev/tclinkenbeard/pr-13287-review-followup
# Conflicts:
#	fdbclient/include/fdbclient/FDBTypes.h
#	fdbserver/core/include/fdbserver/core/WorkerInterface.actor.h
#	flow/ProtocolVersion.h.cmake
#	flow/ProtocolVersions.cmake
2026-07-06 15:32:57 -07:00
Akanksha Mahajan f6a0557f3a
Rename Range Partitioned to consisent name (#13386) 2026-07-03 11:02:24 -07:00
Trevor Clinkenbeard f9faf26e4f Merge remote-tracking branch 'origin/main' into dev/tclinkenbeard/native-fdb-cdc 2026-06-23 15:29:21 -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 ecb82cd453 Merge remote-tracking branch 'origin/main' into dev/tclinkenbeard/native-fdb-cdc 2026-06-03 19:32:31 -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
Trevor Clinkenbeard 270b3d700f Fix CDC lifecycle recovery, retired-tag cleanup, and expiry handling 2026-05-27 13:27:33 -07:00
Trevor Clinkenbeard 9509829902 Add ENABLE_NATIVE_CDC knob 2026-05-27 13:00:28 -07:00
Trevor Clinkenbeard 1808150623 Bound CDC tags and persist stream ID allocation 2026-05-27 05:57:28 -07:00
Trevor Clinkenbeard b46c58415c Replace BUGGIFY macros with inline function 2026-05-20 14:54:51 -07:00
Trevor Clinkenbeard 7301d4a0cd Remove proxy-side quota throttling compatibility path 2026-05-09 20:16:48 -07:00
Trevor Clinkenbeard 0343ab4cbe Address quota throttling review follow-ups 2026-05-09 19:52:46 -07:00
Han Xu 416d9947cc
Make status async and return before we timeout (#12940)
* Fix clusterGetStatus declaration for both actor compiler and clang-ide builds

The actor compiler adds const& to ACTOR params, so the source must use
value params. Clang-ide compiles .actor.cpp directly without the actor
compiler, so it needs a matching value-param declaration. Use
NO_INTELLISENSE guard to provide both.
2026-04-23 09:55:05 -07:00
Trevor Clinkenbeard 4d7a9e5eaa Remove IKnobCollection 2026-04-02 10:39:59 +00:00
Trevor Clinkenbeard 94ceb46dc8 Make (CLIENT|SERVER)_KNOBS direct global pointers 2026-04-02 10:31:18 +00:00
Trevor Clinkenbeard 0b88fa18e3 Add knob helper API wrappers 2026-04-02 10:19:10 +00: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 cf1b0c12dc Remove ParallelStream 2026-03-12 20:05:48 +00:00
Akanksha Mahajan 789eed6ce7
Pull, pop and upload PartitionMap from TLOG for Backup v3 (#12718)
* Peek and Upload Partition Map

* Fix error and add additional comments

* Addressed comments
2026-03-08 17:45:00 -07:00
Baptiste Merliot 36bf564485
Fix timeout unit in backup DR process (#12733)
* fdbdr-timeout-fix

* Update release-notes-700.rst
2026-03-04 16:58:12 -08:00
Trevor Clinkenbeard e3316c6534 Simplify macros 2026-02-19 15:42:18 -08:00
Trevor Clinkenbeard deef2bc8f1 Remove atomic knobs 2026-02-19 15:39:00 -08:00
Trevor Clinkenbeard 28e54b3b16 Buggify BACKUP_READS_USE_LOW_PRIORITY 2026-02-19 11:13:23 -08:00
Trevor Clinkenbeard f927570501 Support low-priority backup reads 2026-02-19 11:13:23 -08:00
gxglass c62bb6bf38
Delete encryption at rest (#12667)
Delete encryption at rest in accordance with plans circulated in PR #12400.

Development of this PR was mostly straightforward. Several issues of note:

Upgrade tests which use Redwood want to use the old "encrypt by 0xFF XOR" test-only encoding/encryption algorithm. I wanted to delete that in main and did so. Upgrade tests have been modified not to use Redwood (storage engine 3, mentioned in various storageEngineExcludeTypes test options updates). 7.1 did not define storageEngineExcludeTypes. After some discussion we have decided to delete 7.1-based upgrade tests. 7.3- and 7.4-based upgrade tests remain in place.

Cross-version compatibility (such as it is, I assume in client library startup) remains super easy to break when deleting code. Tips: (A) removing unnecessary arguments to functions is bread and butter code editing when removing code, but if you find yourself removing arguments from a serializer() invocation, you might be breaking a protocol. (B) run ctest -R upgrade early and often.

An implication of these changes is that we are going to rely on the community to make us aware of any {upgrade+Redwood}-specific bugs. In other words, we are declining to continue to go out of our way to test functionality that we have no plans to use.

On the plus side this reclaims 15,000 more lines of code that we don't have to look at or think about, including in common areas such as commit proxy, backups, and generic storage server code.

Testing:
20260129-230241-gglass-15694f5f80af6932 compressed=True data_size=34905446 duration=4335357 ended=100000 fail_fast=1000 max_runs=100000 pass=100000 priority=100 remaining=0 runtime=6:21:47 sanity=False started=100000 stopped=20260130-052428 submitted=20260129-230241 timeout=5400 username=gglass

20260202-214159-gglass-69b90c779cf8ec68 compressed=True data_size=35007141 duration=4612639 ended=100000 fail_fast=1000 max_runs=100000 pass=100000 priority=100 remaining=0 runtime=3:00:25 sanity=False started=100000 stopped=20260203-004224 submitted=20260202-214159 timeout=5400 username=gglass

* Checkpoint file removals and code edits for removing encryption at rest. Have not tried to compile this yet.

* Checkpoint some improvements.  Still does not compile.

* Merging with upstream changes in copyright updates resurrected previously deleted files, so delete them again

* Checkpoint incremental progress towards getting this to compile

* Checkpoint more intermediate changes getting encryption at rest deleted.  Still doesnt compile but getting closer.

* Changes sufficient to get things to compile with removal of encryption at rest.  NOT TESTED.

* Delete encryptModes from toml files run by current fdbserver binaries; restarting tests using <= 7.4 binaries do need encryptModes to say disabled

* Avoid using MAX_ENCODING_VALUE for random purposes for which other solutions are more clear and generally better

* Stop using XOREncryption_TestOnly because that no longer works.  Also I see no need to support it as it requires unneeded interfaces and test fixtures in order to actually work.

* Remove more page encryption stuff, and address some TODO(gglass) comments.

* debugging redwood failures

* Fix some misc simulation failures.  Notably, disable storage engine type 3 (redwood) on upgrade tests, as it writes databases with encoding type 1 which is no longer supported

* Add a comment discussion deprecation options for fields in persistent metadata, and explain why we are merely renaming the member as deprecated and nothing anything else.

* Remove 7.1 upgrade tests.  These tests enable Redwood and write databases with "0xFF XOR encryption" style encoding (encoding 1), which is removed in main.

* Improve comments

* Obligatory f3f commit.  Format The Effin Source Files

* Delete more unneeded encryption stuff

* Put back about 1% of deleted code in a desperate attempt to unbreak broken protocol compatibility

* formatting

* Remove mentions of encryption at rest in backup related APIs

* Address misc review comments.  Remove --encrypt-files backup option.
2026-02-04 16:02:06 -08: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
gxglass bab7637d87
Delete multitenant and metacluster features (#12583)
These features have been previously marked for deletion per PR #12400.

This change necessarily affects a lot of files. In general I found it preferable to cut along the FDB <-> tenant boundary, rather than try to cut tenant into multiple pieces, stitch the Frankenstein tenant implementation back together with FDB, and generally remove the limbs one by one. So it is a single big deletion.

Note that some tenant-related metadata has been written in a non-flag-controlled manner by prior releases and probably must be ignored indefinitely. Fortunately this is isolated to include/fdbclient/ClientLogEvents.h. (Details: deleting an Optional from a serialized struct results in deserialization of garbage in upgrade tests. The serialized nullopt to indicate "no Tenant" is formally part of FDB persistent metadata even in FDB clusters that never would have enabled the tenant feature.)

During the course of testing these changes, many interesting bugs were encountered. I won't discuss details of them here. Causes range from flat out damage (by me) to production code in the course of removing tenant related bits (mainly in NativeAPI.actor.cpp and CommitProxy.actor.cpp), damage to various workload files (particularly FuzzApiCorrectness.actor.cpp, which is very sensitive to changes), and many toml files needing updated test flags/options.

More testing details: https://quip-apple.com/Zr6VAycxoli9

20251209-012852-gglass-8ff850b772d868f2 compressed=True data_size=35311687 duration=21671404 ended=500000 fail_fast=1000 max_runs=500000 pass=500000 priority=100 remaining=0 runtime=2:31:30 sanity=False started=500000 stopped=20251209-040022 submitted=20251209-012852 timeout=5400 username=gglass

* remove some unneeded tests, and remove mentions of deleted tests from tests/CmakeLists.txt

* Initiate removal of metacluster. NOTE: this seems to also want removal of tenant. Consider removing them together.

* work on removing metacluster

* delete files with `Tenant` in the name, having reviewed them to ensure that they basically contain what the name implies

* fdb_c.h: remove prototypes for C API methods which have been deleted (blob granule) or which are so long deprecated that they are outside any reasonable/documented support window

* Surgical removal of tenant references from files in bindings/ top level directory.  Compilation not yet attempted.

* Surgical removal of tenant related stuff from fdbcli/ top level directory.  Compilation not yet attempted.

* Misc tenant code removal, and other stuff which I think may not be needed.  Compilation still not attempted.

* Remove more tenant or tenant-adjacent or blob-granule-adjacent stuff.  Or at least stuff that looks adjacent to that stuff.  Not compiled or tested.

* Start removing Tenant stuff from fdbclient/.  Far from complete.  Compilation not attempted.

* Remove tenant references from many source files.  There are still about 7 principal fdbclient/ and fdbserver/ files with a lot of tenant logic left to delete. Also, all of fdbserver/workloads needs to be looked at.  Still have not attempted compilation.

* Remove tenant entanglement from watch functionality

* Remove tenant stuff from fdbserver/tester.actor.cpp

* Delete metacluster workloads

* Remove tenant related stuff from workloads.  Also taken the liberty of removing some functionality that appears unused or untestable by Apple.

* Checkpoint tenant removal from FuzzApiCorrectness.actor.cpp

* NativeAPI.actor.cpp: `Tenant` has left the building.

* SimulatedCluster.actor.cpp: `Tenant` has left the building

* DDShardTracker.actor.cpp: Tenant evicted

* storageserver.actor.cpp: `tenant` has left the building.

* fdbserver/workloads/FuzzApiCorrectness.actor.cpp: remove tenant references, but some lingering cleanup needed in `loadAndRun`

* FileBackupAgent.actor.cpp: tenant has left the building

* CommitProxyServer.actor.cpp: remove tenant

* Remove more tenant references from misc files such as bindings tests, documentation, and some fdbserver headers I left earlier

* Fix missing-file errors in CMakeLists.txt files.  This is the first attempt to compile this stuff.

* checkpoint misc changes to fix compile errors

* checkpoint more compile fixes

* StorageServerInterface.h: put back more verify() calls

* More misc compile fixes

* whole bunch of misc fixups including some code put-backs to address compile errors

* More compile fixes

* More compile fixes.  Still does not compile.

* incremental compile fixing

* ...

* ...

* Checkpoint a bunch of compile fixes.  Not quite there but getting closer

* More compile fixes.  There seem to be about 10 files left, mainly CommitProxyServer.actor.cpp and storageserver.actor.cpp

* IT COMPILES NOW.  THIS IS STILL ALL UNTESTED.  Unsurprisingly, CommitProxyServer.actor.cpp and storageserver.actor.cpp took the most tweaking.

The updates in CMakeLists.txt and workloads/UnitTests.actor.cpp are basically trivial and mainly reflect
the ordering of dependencies -- that stuff didn't get attempted until all of fdbserver compiled.

* Put back one block relating to encryption at rest mode.  Simplify some TODO(gglass) instances.

* Put back some encryption related knobs

* remove `enable_tenants` from local_cluster.py to maybe fix some ctests

* Remove tenant related options from toml files.

* feature-status.md: add a line for encryption at rest, which seems to have been added for multi-tenant; status is now in doubt

* Fix a pretty bad bug introduced in tenant deletion; ensure we dont attempt to construct a std::string of negative length

* workloads/FuzzApiCorrectness.actor.cpp: avoid division by zero

* flow/Platform.actor.cpp: add a try/catch wrapper around side threads; emit a better addr2line type command

* NativeAPI.actor.cpp: fix a bug introduced in tenant removal relating to reporting conflicting keys under conflictingKeysRange

* ReportConflictingKeys.actor.cpp: separate an ANDed assert into two asserts

* SpecialKeySPaceCorrectness.actor.cpp: put back some logic removed with tenant removal.  This test was failing due to a bug with conflict key range reporting.  Fixed separately in NativeAPI.actor.cpp.

* remove QuotaCommand.actor.cpp

* Force disable tenant and encryption on disk in upgrade tests

* Add back file I guess I deleted?  who knows

* put back another file

* design/feature-status.md: update the new row for encryption at rest to firm up the claim that it is experimental, unowned, and scheduled for deletion

* Remove EncryptKeyProxyTest since we do not use it

* new file tests/slow/BulkDumpingS3WithChaos.toml: remove tenantModes setting

* Undo damage to pushToBackupMutations() from removing tenant feature.  This caused inverted_range errors and failed commits in backup related simulations.

* tests/restarting/from_7.4.0/Snap*-1: ensure that tenantModes = disabled

* Try again on workloads/FuzzApiCorrectness.actor.cpp

* simplify tenant-free (mostly) FuzzApiCorrectness workload code

* try harder to remove lingering tenant-related brokenness from FuzzApiCorrectness.actor.cpp

* Explicitly specify tenantModes = ['disabled'] in all the -1 restart files

* Remove tenantModes from 7.1-based upgrade tests as its an unknown option.  Hopefully the code doesnt actually turn on tenant stuff

* do not specify tenantModes in downgrade tests

* Downgrade test to_7.4.5: dont say tenantModes

* more tenantModes updates

* Remove a legacy allowDefaultTenant that no longer is meaningful in downgrade to 8.0

* Put back empty Optional<TenantName> turdlets into serialized log events to avoid breaking ClientTransactionProfilingCorrectness upgrade tests (even with tenantMode = disabled)

* disable encryption on a few more upgrade related test cases.  That feature is slated for removal anyway

* Remove unneeded workload files that have been subject to #if 0 for a while. Remove commented out block in ClusterRecovery

* disable encryption in more upgrade tests

* Remove choice four-letter words from commentary

* Format 42 files

* Try to fix a doc bug failing the CI build

* More doc compilation error fixes

* Delete more tenant junk from documentation

* fix spelling mistake in comment

* Remove deleted cross-references from documentation.  This necessitated editing release 3.0.0 release notes, which is insane.

* Remove more tenant stuff from bindings tests

* Remove more tenant bits from design/ files

* Remove more tenant related stuff

* Delete more tenant references.  Put back ten-ant spellings as tenant now that grep output is substantially reduced.

* Put back some tenant stuff into apitester; its deletion seems to have introduced bugs.  Also whine about comments some more, because, really, the comments deserve it.

* Updates to workload files and one other thing based on review comments

* de-actorify decodeKVPairs

* format one source file

* Restore transaction tagging doc

* Restore throttle doc details in administration.rst

* Restore fdbserver/workloads/GetEstimatedRangeSize.actor.cpp and associated toml file, minus tenant stuff

* bindings/c/test/{shim related}: update comments and disable functionality that no longer works post-tenant

* put the cli-throttle tag back in

* bindingtester: fix python syntax errors

* remove useless comment

* Remove comment about useless comments, and remove the useless comments
2025-12-09 12:39:41 -08:00
Vishesh Yadav 48d9e90d89 Add `fdbctl` library and ControlService gRPC Service
'fdbctl' aims to implement control plane layer for FoundationDB.
This includes general operations related to cluster management,
getting service health etc. This is all exposed via ControlService
with interface described in 'control_service.proto'.

Eventually 'fdbcli' and 'ControlService' can both reuse 'fdbctl'
in library much of what 'fdbcli' does is within scope of this
component.
2025-11-05 18:22:44 -08:00
Syed Paymaan Raza 596f4cba6d
5s - introduce fuzzed write transaction delay knob for simulation (#12464)
* 5s: fuzz write knob

* self review

* self review

* self review

* looks like AutomaticIdempotency.toml works, so revert my changes there

* fix spacing
2025-11-05 18:04:12 -08:00
Michael Stack b9f1dce6ad
Add chaos to S3BulkDumping test. (#12522)
- Add chaos injection support to BulkDumping workload
- Added MockS3ServerChaos include to BulkDumping.actor.cpp
- Added chaos configuration options (errorRate, throttleRate, delayRate, corruptionRate, maxDelay)
- Enhanced _setup() to support both regular and chaos MockS3 servers
- Added detection for already-registered servers to avoid conflicts
- Configure chaos rates per-test to allow progressive intensity testing
- Created BulkDumpingS3WithChaos.toml test suite with 4 test scenarios:
  * Stable (0% chaos) - baseline
  * Light chaos (5-10%) - minor disruptions
  * Medium chaos (15-20%) - moderate disruptions
  * Heavy chaos (30-40%) - severe disruptions

This mirrors the S3ClientWorkloadWithChaos design and allows testing
BulkDumping resilience to S3 failures in simulation.

The validateBulkLoadJobHistory function incorrectly asserted that every
job in history had the same jobId, when it should have been searching
for a specific job. This caused crashes when multiple jobs existed in
history from cancellations/retries during chaos testing.

* Fix bulk load hangs with empty ranges and improve chaos test resilience

Empty Range Handling Fixes:
1. BulkLoadUtil.actor.cpp (bulkLoadDownloadTaskFileSets):
   - Fixed root cause where empty ranges were skipped entirely with 'continue',
     never added to localFileSets, causing FetchKeys to hang forever
   - Now creates empty BulkLoadFileSet entries for empty ranges to track them

2. BulkLoadUtil.actor.cpp (bulkLoadTransportBlobstore_impl):
   - Added hasDataFile() check before attempting S3 downloads
   - Skip data file download gracefully for empty ranges

3. storageserver.actor.cpp (tryGetRangeForBulkLoad):
   - Added hasDataFile() check to prevent calling getDataFileFullPath() on empty fileSets
   - Added empty result signaling: when all ranges are empty, send empty RangeResult
     with end_of_stream() to properly complete FetchKeys operations

4. storageserver.actor.cpp (bulk load SST ingestion):
   - Added hasDataFile() checks before accessing data file paths during SST processing

5. storageserver.actor.cpp (restoreDurableState):
   - Improved bulk load recovery robustness by using intersectingRanges() instead
     of exact range match during storage server recovery
   - Handle range boundary mismatches that can occur due to splits/chaos
   - Added comprehensive error logging for debugging recovery issues

Performance and Retry Improvements:
1. Added BULKLOAD_DOWNLOAD_RETRY_DELAY knob (2.0s for both simulation and production)
2. Added BULKLOAD_DOWNLOAD_MAX_RETRIES knob (20 for both simulation and production)
   - Total retry window: 20 retries × 2s = 40 seconds maximum
3. Reduced BLOBSTORE_MAX_DELAY_RETRYABLE_ERROR from 60s to 20s in production
4. Added retry limits to prevent infinite retry loops in bulk load downloads
2025-11-04 09:01:26 -08:00
gxglass b1d6dcf0e7
Delete blob granule feature (#12435)
This is the first experimental feature to be deleted in the list published at PR #12400.

There is more code here than I anticipated. It is about 40,000 lines total, of which about three quarters are in dedicated files which I am deleting, and about one quarter is in shared files. That means about 10k lines in shared files, which is the stuff we tend to notice day to day (that plus the test failures on heretofore not-yet-disabled test cases, which I am now deleting).

I ran 3 million simulations, mostly against 692df86 or very similar code (differing by one TraceEvent). This was prior to syncing with upstream/main, which had no conflicts and from which I don't expect problems. The number of failures in these runs was about 8. We looked at them and believe there is a high likelihood that these are existing issues not related to the changes in this PR. More details on these failures can be found in docs linked from here: https://quip-apple.com/MN7gAyXLjgyn

* change Long Term status for unowned features for "scheduled for deletion" where applicable

* Relax wording about scheduled for deletion features

* Delete blob granule feature.  WIP.  Does not compile.

* more incremental hacking to remove / comment out blob granule related code

* more hacking to remove blob granule related code, e.g. blob manager and blob migrator roles

* delete more blob granule stuff

* more hacking

* more hacking

* more hacking

* More changes to remove blob granule related code.  IT COMPILES NOW

* dont try to run AuthzSecurity tests as we have deleted that workload as part of this effort

* delete more stuff that matches, abbreviates, or smells like blob granule related

* EncryptKeyProxy: dont do blobMetadata stuff, because that is not used and support is being removed

* delete more references to blob granule stuff

* SimulationConfig::setEncryptionAtRestMode: always use DISABLED; also disable EncryptKeyProxyTest.toml

* format code

* manual update to bindings/java/src/tests.cmake to remove a deleted file

* fix compile errors.  I guess by default I dont build Java bindings

* remove unneeded blob granule functions rather than #if..#endif them out

* remove more code in #if..#endif

* remove more code in #if 0..#endif

* revert changes to fdb_c.h in preparation for marking removed API calls as removed

* rework C API declarations to in preparation for marking blob granule APIs as removed

* deprecate removed glob granule related API functions as of version 740 (and add a comment to request a justification of this convention)

* make progress on broken ctests.  E.g. 1) python does not need to do blob granule stuff.  2) authz tests seemingly not needed

* remove blob granule stuff from Java and Python APIs and fix test runner stuff so that ctests pass

* reformat comments to fix compile error.  FIXME: why is this error not happening on the default compile commands we use

* hacks all the way down to try to fix the Mac build

* add pointed comment about the perceived pointlessness of the API deprecation scheme embodied in this source file

* really serious about the C++ style comments, arent we

* remove commented-out code from prior iterative efforts

* put back undeleted code in original order

* delete commented-out code

* update feature-status.md to say blob granule is mostly deleted

* upgrade `mostly deleted` to `has been deleted`
2025-10-13 16:18:56 -07:00
Syed Paymaan Raza 48b6b4cafa
5s - document and organize knobs (#12421)
* 5s: document and organize knobs

* self review

* address feedback
2025-10-09 10:45:26 -07:00
Drew Gulino e130005310
database configuration error reporting (#12378)
* refactor: Improve DatabaseConfiguration::isValid() debuggability

* Refactor: Only log `log_test` failures to stderr

Co-authored-by: aider (vertex_ai/gemini-2.5-pro) <aider@aider.chat>

* added comments to document

* ran clang-format DatabaseConfiguration.cpp

* docs: Clarify fprint call condition in isValid()

* refactor: Add boolean parameter to isValid to conditionally print log_test output

* Refactor: Add print_invalid param to DatabaseConfiguration::isValid

Co-authored-by: aider (vertex_ai/gemini-2.5-pro) <aider@aider.chat>

* chore: Add comment about print_invalid parameter

* chore: Remove fulfilled AI instruction comment

Co-authored-by: aider (vertex_ai/gemini-2.5-pro) <aider@aider.chat>

* added client knob cli_print_invalid_configuration to enable printing of database configuration test failures in fdbcli

* ran clang-format

---------

Co-authored-by: aider (vertex_ai/gemini-2.5-pro) <aider@aider.chat>
2025-09-26 14:40:13 -07:00
Akanksha Mahajan 4ec8f76333
Backup encryption fix on S3 (#12289)
* Backup encryption fix

* Add enable_read_cache option to be selected randomly to cover both code paths.

* Add randomization in ClientKnobs for testing
2025-08-07 12:34:53 -07:00
Jillian Crossley 15dd76a7f9
Use ListObjectsV2 in S3 Blobstore client (#12238)
Adds a --recursive option for ls to the s3client command tool.
Adds test to s3client ctest.

* Fix a heap-use-after-free corruption bug revealed running against s3
=================================================================
==1988376==ERROR: AddressSanitizer: heap-use-after-free on address 0x508000012020 at pc 0x0000014b7bc2 bp 0x7ffca9e22410 sp 0x7ffca9e21bd0
WRITE of size 80 at 0x508000012020 thread T0
    #0 0x0000014b7bc1 in __asan_memcpy /tmp/llvm-project/compiler-rt/lib/asan/asan_interceptors_memintrinsics.cpp:63:3
    #1 0x0000043f5c83 in XXH64_reset /root/src/foundationdb/flow/include/flow/xxhash.h:1977:2
    #2 0x00000337a336 in (anonymous namespace)::CopyUpFileActorState<(anonymous namespace)::CopyUpFileActor>::a_body1loopBody1(int) /root/src/foundationdb/fdbclient/S3Client.actor.cpp:429:2
2025-07-17 11:48:52 -07:00
Michael Stack 76c606c9d6
Fix and default to S3 'integrity' checking with SHA256 checksums instead of md5 when doing multipart files (only worked for small files previously). (#12246)
Add/fix SHA256 checksum support for S3 operations when
BLOBSTORE_ENABLE_OBJECT_INTEGRITY_CHECK is enabled.

- Add SHA256 support to multipart upload initiation and completion
  (stronger integrity check).
- Update PartInfo structure to support both etag and checksum
- Fix AsyncFileS3BlobStore to use SHA256 consistently with other implementations when BLOBSTORE_ENABLE_OBJECT_INTEGRITY_CHECK is set
- Enable integrity checking by default
- Doc our checksumming story now it is getting a little involved. Add
  reference from backup design doc.
2025-07-15 12:23:03 -07:00
Zhe Wang 8b7ac8a561
Avoid Source Storage Server Being Overloaded by Data Movements with Replica Consistency Check (#12164)
* add ss metrics for fetch key

* bug fix

* revert checkTimeSpanSec

* fix adjustRelocationParallelismForSrc

* code cleanup

* fix replicaComparison

* remove unnecessary counters

* fix large storage server data structure

* address comments

* address comments

* address comments

* code cleanup

* bug fix

* fix bug
2025-05-30 14:01:30 -07:00
Syed Paymaan Raza 27dfa6ca62
Disable ENABLE_REPLICA_CONSISTENCY_CHECK_ON_BACKUP_READS by default (#12132) 2025-05-07 11:28:30 -07:00
Michael Stack 20be6dc16e
Add multipart retry delay configuration. (#12076)
Add documentation to .h file.

Co-authored-by: stack <stack@duboce.com>
2025-04-04 14:22:46 -07:00
Zhe Wang c8f9066e3f
disable mutation checksum and accumulative checksum by default and add trace for audit storage (#12042) 2025-03-19 13:15:22 -07:00
Zhe Wang eb0d9f2028
Add Verbose Level for BulkLoad Trace Events (#12034)
* add level for DDBulkLoad except for datadistribution

* nits
2025-03-14 19:15:41 -07:00
Zhe Wang 8142ebd029
Add BulkLoad History (#11992)
* add bulkload history

* address comments

* address comments
2025-03-04 18:50:08 -08:00
neethuhaneesha 5872ef711b
Temporarily disabling backup dry run request until the issue is fixed (#11991) 2025-03-03 15:52:30 -08:00
flowguru fe47ce24d3
New restore consolidated commit (#11901)
* New restore consolidated commit

This change adds RestoreDispatchPartitionedTaskFunc to restore
from partitioned-format backup.

* ArenaBlock::totalSize parameter pass by ref

* Fix format issues identified by CI
2025-01-22 14:54:55 -08:00
michael stack 4d835c542c Have ctests use s3 if it is available.
Fix object integrity check; original approach doesn't work when
serverside encryption is enabled (awz:kms).

* contrib/SimpleOpt/include/SimpleOpt/SimpleOpt.h
 Address sanitizer was complaining about how SimpleOpt manipulates the
 array of options. While memcpy inside a buffer is 'odd', it seems fine.
 Its old code. Leaving it.

* fdbbackup/tests/s3_backup_test.sh
 Pass in weed_dir rather than rely on fixture global (the latter didn't
 work).

* fdbclient/ClientKnobs.cpp
* fdbclient/include/fdbclient/ClientKnobs.h
* fdbclient/include/fdbclient/S3BlobStore.h
 Add a knob to ask for object integrity check on download from s3.
 BLOBSTORE_ENABLE_OBJECT_INTEGRITY_CHECK replaces BLOBSTORE_ENABLE_ETAG_ON_GET
 which doesn't work when serverside encodes content (found in testing).

* fdbclient/S3BlobStore.actor.cpp
 Implement object integrity check on download. If
 enable_object_integrity_check is set, we use sha256 in place of md5
 as our hash. Removed a redundant 'verify' of md5 check.

* fdbclient/S3Client.actor.cpp
 Remove unhelpful comments.

* fdbclient/S3Client_cli.actor.cpp
 Add support for enable_object_integrity_check. This knob replaces
 enable_etag_on_get which didn't work when awz:kms serverside
 encryption was enabled.
 Add error code on exit when exception.

* fdbclient/include/fdbclient/S3Client.actor.h
 Move an include (address a review comment from previous commit).

* fdbclient/tests/aws_fixture.sh
 Add an aws fixture of utility that can be shared.

* fdbclient/tests/bulkload_test.sh
 Use imported log_test_result

* fdbclient/tests/s3client_test.sh
 Add using s3 if available; otherwise, do seaweedfs.

* fdbclient/tests/seaweedfs_fixture.sh
 WEED_DIR global doesn't work so have caller pass it in for each method
 instead.
2025-01-14 13:13:15 -08:00
michael stack 4c1e74105e Add checksum checking of downloads. Add cleanup of test data.
* fdbclient/ClientKnobs.cpp
* fdbclient/include/fdbclient/ClientKnobs.h
 Add knob BLOBSTORE_ENABLE_ETAG_ON_GET

* fdbclient/S3BlobStore.actor.cpp
 Optionally check etag (md5) volunteered by s3 against the
 content we have downloaded and fail if not equal (TODO:
 check the checksum after we've saved the content to the
 filesystem --  would require  good bit of a refactoring).

* fdbclient/S3Client.actor.cpp
 Add deleteResource support.

* fdbclient/S3Client_cli.actor.cpp
 Add COMMAND support; currently either 'cp' or 'rm'.
 Set the knob blobstore_enable_etag_on_get to true by
 default for s3client.

* fdbclient/tests/s3client_test.sh
 Add clean up of resources written up to s3 at end of test.
 (Awkward in bash)
2025-01-06 13:50:19 -08:00
flowguru ec2dde29fc
Fix backup dryrun bug (#11787)
* Fix backup dryrun bug

Currently there is a out-of-scope issue, this change also adds
a knob to control whether to allow dryrun of backup

* fix another bug that misses a wait statement

---------

Co-authored-by: Hao <fdbflowguru@gmail.com>
2024-11-15 11:56:03 -08:00
Zhe Wang 43446204ed
Database Per-Range Lock (#11693)
* range lock framework

* improve the framework

* persist to txnStateStore

* fix bugs

* code clean

* code clean

* bug fix

* address comments

* add complex test workload and fix bugs found by the workload

* add workload correctness check and fix bugs

* code clean up

* add random range lock injection

* fix bugs in RandomRangeLock.actor.cpp

* enable random range lock injection in general workloads

* add rangelockcycle test

* disable random range lock in backup workloads

* nits

* add range lock ownership concept

* enable lock ownership to rangeLock

* api deal with tenant

* fix CI

* add test for multiple rangeLock owners

* nits

* address comments and renaming

* address comments
2024-10-23 16:25:56 -07:00