Commit Graph

220 Commits

Author SHA1 Message Date
Jingyu Zhou 2d2a2144f4
Update copyright years to 2013-2026 (#12653)
No functional changes.
2026-01-22 10:49:41 -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
Jingyu Zhou 73f58d561f
Increase quiet database checker time (#12501)
Simulation found a case data movement takes longer to complete.

To repro on release-7.4 clang:

commit: ef0e70739f
seed: -f ./tests/fast/InventoryTestAlmostReadOnly.toml -s 583837717 -b off
2025-10-23 09:33:12 -07: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
Jingyu Zhou 7d24127ad0 Disable backup workers when no active partitioned backups
Currently, when submitting backup, backup workers will be enabled for partitioned backups.
However, we didn't clear the backup worker setting if no partitioned backup is active,
which will cause backup workers to be recruited, but doing nothing.

This PR changes the behavior so that when submitting, aborting, or discontinuing
backups, we'll disable backup workers if there is no active partitioned backup jobs.

20250517-162642-jzhou-4966348e89f1794d
20250517-044345-jzhou-f02f7defca3ea010
2025-05-17 09:27:08 -07:00
Jingyu Zhou a5d2a58272 Pause backup workers during quite database
Because in NOOP mode, backup workers still writes to the database, and cause
non-empty storage queues.
2025-02-17 09:50:29 -08:00
Sepeth 3854dbfe4d
Upgrade fmt from 8.1.1 to 11.0.2 (#11601)
And, added via cmake FetchContent, and removed contrib/fmt-8.1.1
2024-09-10 14:42:43 -07:00
Syed Paymaan Raza c3e7542cda Update end year in copyright header 2024-08-02 09:40:11 -07:00
Xiaoge Su afc04366fb Rewrite BUGGIFY related code
This is a rewrite of BUGGIFY function/macros. Seems the performance
improved a lot during the simulation, e.g.

fdbserver -r simulation -b on -f ../CycleTest.toml -s 99438

Without this patch:

Unseed: 54646
Elapsed: 494.091327 simsec, 14.586831 real seconds

With this patch:

Unseed: 54646
Elapsed: 494.091327 simsec, 12.580612 real seconds

I expected the improvement but did not expect a ~13% improvement.
2024-06-17 11:41:06 -07:00
Dimitris Apostolou a88114c222
Fix typos 2024-02-07 01:16:00 +02:00
Jingyu Zhou d27a81ff58 Increase DataCenter Lag gate to 100
Found test failure due to 30s gate being too small:

./fdbserver.6.3.16 -r simulation -f ./tests/restarting/from_6.3.13_until_7.2.0/DrUpgradeRestart-1.txt -s 3218805329 -b on --logsize 1GB
-f ./tests/restarting/from_6.3.13_until_7.2.0/DrUpgradeRestart-2.txt --restarting -s 3218805330 -b on

clang build
commit 7d5d1e082
2023-09-25 17:12:17 -07:00
Josh Slocum 356d0030a4
fixed consistency scan corruption check when worker is hard-killed in the middle, and improved debugging for stuck consistency scan (#10516) 2023-06-22 11:54:08 -05:00
Josh Slocum b209cd5d19
Consistency scan polish (#10445)
* added operational metrics and some polish

* moving consistency scan enablement in simulation tests to main tester workflow

* more stats and throttling polish
2023-06-08 14:18:58 -05:00
Dan Adkins fead5ed494
Log reason for QuietDatabase check failure. (#9775)
An 'attribute_not_found' error was slipping through the cracks
when attempting to get the max storage queue size for a storage
server which has been removed. This change explicitly logs the
error where it occurs, making it easier to debug.
2023-03-23 15:02:51 -04:00
A.J. Beamon ffcf51b732 Once we start repairing a dead datacenter, don't allow it to be canceled 2023-03-21 14:44:58 -07:00
Markus Pilman 7a108a2768 Add framework for writing negative simulation tests 2023-03-15 11:22:25 -07:00
Markus Pilman 7eaf999644 reverting testing code 2023-03-06 17:38:41 -07:00
Markus Pilman 0838bfcfa2 Allow workloads to log errors when test times out 2023-03-06 17:36:26 -07:00
Evan Tschannen 8129381689 merge in main 2023-02-21 12:06:35 -08:00
Jingyu Zhou 99a8bfda11 Reorder trace events 2023-02-15 12:27:17 -08:00
Jingyu Zhou 02cdd0e1db Fix exclusion in repairDeadDatacenter to be remote only
If primary is excluded, the recovery will become stuck because no servers can
be recruited in the next time.
2023-02-15 11:15:18 -08:00
Evan Tschannen c0597cc614 the blob worker uses affinity when assigning ranges on startup or after a failure 2023-02-14 11:16:59 -08:00
Jingyu Zhou 622520bd2d Return the source team if remote DC is dead
Also refactor the code with findTeamFromServers().
2023-02-10 11:11:07 -08:00
Jingyu Zhou 9aa15b459c Clean up trace events 2023-02-10 11:11:07 -08:00
Jingyu Zhou 6c4a9b5f23 Fix DD stuck when remote DC is dead
When remote DC is down, the remote team collection of DD can initializing
waiting for the remote to recover (all_tlog_recruited state). However, the
getTeam request can already be served by the remote team collection. So, for
a RelocateShard (data movement such as split, move), it will get a team for
the remote DC. But the data movement can't make progress on the remote team
because the remote DC hasn't recovered yet. Because of the stuck of data
movement, the primary cannot reach the "storage_recovered" state and stay in
accepting_commit state.

The specifc test failure: slow/ApiCorrectness.toml -s 339026305 -b on
at commit:  0edd899d65

In this test, primary DC has 1 SS killed, remote DC has 2 TLog and 2 SS killed.
So the remote is dead, the remaining 2 SSes can't make progress because of the
loss of 2 TLogs. The repairDeadDatacenter() can't reach the "storage_recovered"
state due to DD's failure of moving shards away from the killed SS in the
primary.

The fix is to exclude all remote in repairDeadDatacenter() so that tells DD to
mark all SSes in the remote as unhealthy. Another fix is to return empty
results for getTeam request if the remote team collection is not ready. This
will allow the data movement to continue, essentially remote team is not changed
for the data movement.
2023-02-10 11:11:07 -08:00
Chaoguang Lin fce9490c19 A Fix from Evan 2023-01-25 15:55:24 -08:00
Xiaoxi Wang bbcb3cc018 extract KeyBackedConfig, StorageWiggleData class; solve template resolution problem; solve MV txn and native api conflict by splitting RunTransaction file 2023-01-02 23:34:39 -08:00
Jingyu Zhou f2847cee6d Add DC lag check in quiet database checks
This is to be consistent with production deployment.
2022-12-19 20:04:46 -08:00
Josh Slocum 23206257ef
Fix feed metadata reset (#8751)
* re-making feed metadata durable on private mutation reset

* cleaning up unrelated code
2022-12-09 12:03:41 -08:00
Jon Fu 3c08901d2c
Kill datacenter in simulation as part of repair process (#8914)
* kill datacenter in simulation as part of repair process

* fix typo
2022-12-05 18:09:51 -05:00
A.J. Beamon 304747d387 The simulator was changing the configuration of the cluster while the consistency check was expecting a quiescent database 2022-11-03 08:35:34 -07:00
Markus Pilman 550488b020 Merge remote-tracking branch 'origin/main' into bugfixes/open-for-ide
# Conflicts:
#	bindings/c/CMakeLists.txt
#	fdbclient/include/fdbclient/GetEncryptCipherKeys.actor.h
#	fdbserver/BackupWorker.actor.cpp
#	fdbserver/BlobWorker.actor.cpp
#	fdbserver/CommitProxyServer.actor.cpp
#	fdbserver/KeyValueStoreMemory.actor.cpp
#	fdbserver/StorageCache.actor.cpp
#	fdbserver/include/fdbserver/GetEncryptCipherKeys.actor.h
#	fdbserver/storageserver.actor.cpp
#	fdbserver/workloads/PhysicalShardMove.actor.cpp
#	flow/CMakeLists.txt
2022-10-04 18:27:48 -06:00
Markus Pilman 97dfc6823f fixed build with OPEN_FOR_IDE 2022-10-04 17:01:02 -06:00
A.J. Beamon 4fd64630e8 Convert literal string ref instances to use _sr suffix 2022-09-19 11:35:58 -07:00
sfc-gh-tclinkenbeard 82adc1e856 Make g_simulator a pointer 2022-09-15 09:00:33 -07:00
Bharadwaj V.R bfb19b5983 (Temporarily) Further bump the quiet-database timeout when buggify is enabled 2022-08-18 11:19:00 -07:00
Evan Tschannen a9d3c9f9b3
Added throttling when a blob worker falls behind (#7751)
* throttle the cluster when blob workers fall behind

* do not throttle on blob workers if they are not enabled

* remove an unnecessary actor

* fixed a compile error

* fetch blob worker metrics at the same interval as the rate is updated, avoid fetching the complete blob worker list too frequently

* fixed another compilation bug

* added a 5 second delay before bw throttling to prevent false positives caused by the 100e6 version jump during recovery. Lower the throttling thresholds to react much quicker to bw lag.

* fixed a number of problems

* changed the minBlobVersionRequest to look at storage server versions since this will be a lot more efficient

* fix: do not let desired go backwards

* fix: track the version of notAtLatest changefeeds for throttling

* ratekeeper now throttled blob workers by estimating the transaction per second throughput of the blob workers

* added metrics for blob worker change feeds

* added a knob to disable bw throttling

* fixed the transaction options in blob manager
2022-08-12 13:15:56 -07:00
He Liu bc5bfaffda
Shard based move (#6981)
* Shard based move.

* Clean up.

* Clear results on retry in getInitialDataDistribution.

* Remove assertion on SHARD_ENCODE_LOCATION_METADATA for compatibility.

* Resolved comments.

Co-authored-by: He Liu <heliu@apple.com>
2022-07-07 20:49:16 -07:00
Bharadwaj V.R 71705bf930 Increase timeout for QuietDatabase when buggify is on 2022-06-27 23:03:00 -07:00
Bharadwaj V.R 990c789a5c
Increase quiet-database timeout when buggify is on; data-movements in simulation take longer than the timeout allows, and waiting for quiet-database does succeed when given some more time (#7290) 2022-06-06 13:13:11 -07:00
A.J. Beamon 917b271a37
Merge pull request #6996 from sfc-gh-mpilman/features/fail-quietdatabase-before-timeout
Make QuietDatabase more human friendly
2022-05-10 08:36:25 -07:00
Markus Pilman e0cbe74d94 Only fail DD early in simulation 2022-04-28 11:32:35 -06:00
Markus Pilman eb22ac1c1f Address review comments 2022-04-28 10:09:06 -06:00
Markus Pilman f959e84b85 fix comparison 2022-04-28 09:46:28 -06:00
Markus Pilman 74abca44d8 Make QuietDatabase more human friendly
QuietDatabase will now fail by itself after 1000 seconds
instead of relying on the general simulation timeout.
Additionally it will print a more human friendly error.
2022-04-28 09:15:20 -06:00
Renxuan Wang c69a07a858
Check in the new Hostname logic. (#6926)
* Revert #6655.

20220407-031010-renxuan-c101052c21da8346           compressed=True data_size=31004844 duration=4310801 ended=100000 fail_fast=10 max_runs=100000 pass=100000 priority=100 remaining=0 runtime=1:04:15 sanity=False started=100047 stopped=20220407-041425 submitted=20220407-031010 timeout=5400 username=renxuan

* Revert #6271.

20220407-051532-renxuan-470f0fe6aac1c217           compressed=True data_size=30982370 duration=3491067 ended=100002 fail_fast=10 max_runs=100000 pass=100002 priority=100 remaining=0 runtime=0:59:57 sanity=False started=100141 stopped=20220407-061529 submitted=20220407-051532 timeout=5400 username=renxuan

* Revert #6266.

Remove resolving-related functionalities in connection string. Connection string will be used for storing purpose only, and non-mutable.

20220407-175119-renxuan-55d30ee1a4b42c2f           compressed=True data_size=30970443 duration=5437659 ended=100000 fail_fast=10 max_runs=100000 pass=100000 priority=100 remaining=0 runtime=0:59:31 sanity=False started=100154 stopped=20220407-185050 submitted=20220407-175119 timeout=5400 username=renxuan

* Add hostname to coordinator interfaces.

* Turn on the new hostname logic.

* Add the corresponding change in config txns.

The most notable change is before calling basicLoadBalance(), we need to call tryInitializeRequestStream() to initialize request streams first.

Passed correctness tests.

* Return error when hostnames cannot be resolved in coordinators command.

* Minor fixes.
2022-04-27 21:54:13 -07:00
Trevor Clinkenbeard ba8fbca038
Merge pull request #6752 from sfc-gh-tclinkenbeard/improve-snapshot-fault-tolerance
Improve fault tolerance of snapshots
2022-04-08 12:46:50 -07:00
Lukas Joswiak 73a7c32982
Add fdbcli command to read/write version epoch (#6480)
* Initialize cluster version at wall-clock time

Previously, new clusters would begin at version 0. After this change,
clusters will initialize at a version matching wall-clock time. Instead
of using the Unix epoch (or Windows epoch), FDB clusters will use a new
epoch, defaulting to January 1, 2010, 01:00:00+00:00. In the future,
this base epoch will be modifiable through fdbcli, allowing
administrators to advance the cluster version.

Basing the version off of time allows different FDB clusters to share
data without running into version issues.

* Send version epoch to master

* Cleanup

* Update fdbserver/storageserver.actor.cpp

Co-authored-by: A.J. Beamon <aj.beamon@snowflake.com>

* Jump directly to expected version if possible

* Fix initial version issue on storage servers

* Add random recovery offset to start version in simulation

* Type fixes

* Disable reference time by default

Enable on a cluster using the fdbcli command `versionepoch add 0`.

* Use correct recoveryTransactionVersion when recovering

* Allow version epoch to be adjusted forwards (to decrease the version)

* Set version epoch in simulation

* Add quiet database check to ensure small version offset

* Fix initial version issue on storage servers

* Disable reference time by default

Enable on a cluster using the fdbcli command `versionepoch add 0`.

* Add fdbcli command to read/write version epoch

* Cause recovery when version epoch is set

* Handle optional version epoch key

* Add ability to clear the version epoch

This causes version advancement to revert to the old methodology whereas
versions attempt to advance by about a million versions per second,
instead of trying to match the clock.

* Update transaction access

* Modify version epoch to use microseconds instead of seconds

* Modify fdbcli version target API

Move commands from `versionepoch` to `targetversion` top level command.

* Add fdbcli tests for

* Temporarily disable targetversion cli tests

* Fix version epoch fetch issue

* Fix Arena issue

* Reduce max version jump in simulation to 1,000,000

* Rework fdbcli API

It now requires two commands to fully switch a cluster to using the
version epoch. First, enable the version epoch with `versionepoch
enable` or `versionepoch set <versionepoch>`. At this point, versions
will be given out at a faster or slower rate in an attempt to reach the
expected version. Then, run `versionepoch commit` to perform a one time
jump to the expected version. This is essentially irreversible.

* Temporarily disable old targetversion tests

* Cleanup

* Move version epoch buggify to sequencer

This will cause some issues with the QuietDatabase check for the version
offset - namely, it won't do anything, since the version epoch is not
being written to the txnStateStore in simulation. This will get fixed in
the future.

Co-authored-by: A.J. Beamon <aj.beamon@snowflake.com>
2022-04-08 12:33:19 -07:00
sfc-gh-tclinkenbeard e3acbd1388 Fix bug in getStorageWorkers 2022-04-08 11:21:29 -07:00
sfc-gh-tclinkenbeard 91930b8040 Remove getMinReplicasRemaining PromiseStream.
Instead, in order to enforce the maximum fault tolerance for snapshots,
update getStorageWorkers to return the number of unavailable storage
servers (instead of throwing an error when unavailable storage servers
exist).
2022-04-07 23:23:23 -07:00