Commit Graph

304 Commits

Author SHA1 Message Date
gxglass 0bc25f0438
Add 66 counters for 22 DD or related transactions to count begin, commit, and abort for each (#13062) (#13097)
Problem: some of these transactions have been observed to involve cascades of many shards trying to execute them simultaneously owing to somewhat unpredictable DD dynamics. This then results in DD being pegged on CPU with many failing transactions.

Solution: the counters here will make it clear if this is happening and if so, where, so that further mitigations/solutions can be devised. Some of these code paths have TraceEvents, but some don't and of the existing TraceEvents, many are sampled. This PR avoids all of that and counts every time through, making us less reliant on guesswork.

An alternative approach (not taken here for many reasons) would be to instrument transaction code to let callers pass a tag. Then have the transaction client and/or server side emit a few metrics (started, committed, aborted) parameterized by tag.

One may reasonably object that the boilerplate here is kind of fugly. I guess my view is that at this late date the time for more subtle approaches has come and gone. We need this code to tell us what it is doing and if this looks a little intrusive, so be it.

Testing:
20260422-234326-gglass-2f514436068d99e6 compressed=True data_size=35519571 duration=5298275 ended=100000 fail=1 fail_fast=10 max_runs=100000 pass=99999 priority=100 remaining=0 runtime=0:55:44 sanity=False started=100000 stopped=20260423-003910 submitted=20260422-234326 timeout=5400 username=gglass
2026-04-28 17:37:09 -07:00
Michael Stack 02be074632
Forward-port to 7.4: Add DD init and team collection logging for diagnosing slow startups (#13002)
* Add DD init visibility, metrics retries, shard tracking, scan progress, and team collection logging (#12913)

Add logging throughout DD startup and runtime to diagnose slow startups,
stuck data moves, and undesired server classification.

DDTxnProcessor: Log elapsed time for server list + data move read
transaction and keyServer scan. Warn when getRange(dataMoveKeys) takes
over 5 seconds.

DataDistribution: Add NumShards and NumServers to DDInitGotInitialDD.
Add DDInitResumedDataMoves summary with ValidMoves, CancelledMoves,
EmptyMoves counts and elapsed time. Log DD exit reason as DDExiting
at SevWarn. Add DDInit-prefixed trace events throughout startup sequence.

DDTeamCollection: Add Reason and Address details to UndesiredStorageServer
trace events to distinguish version lag, same-address, wrong-class, and
exclusion causes.

DDShardTracker: Log TrackInitialShardsComplete with shard count and
TrackInitialShardsMetricsComplete with elapsed time.

NativeAPI: Add retry counting and logging for getStorageMetrics timeouts.

* Remove double trace

* Fix DD trace event issues: rate-limit warns, deduplicate events, fix DDExiting

- Wire up unused lastLogTime in waitStorageMetrics to rate-limit SevWarn
  events to once per 10s after the 60s threshold. Previously every retry
  (up to 100/s with 10ms WRONG_SHARD_SERVER_DELAY) emitted SevWarn.

- Remove redundant DataDistributorRunning and DDInitRunning events inside
  the try block. Rename the original DataDistributorRunning to DDInitRunning
  so a single event serves both purposes and fits the DDInit* query pattern.

- Move DDExiting to the three actual throw sites so it only fires on
  terminal exits, not on retries of movekeys_conflict/dd_config_changed
  when DD is disabled.

* Trim over-apologetic DDInitDone comment
2026-04-22 19:57:28 -07:00
Zhe Wang a9cc2dd7dc
Cherrypick recent bulkload changes (#12135)
* Add multipart retry delay configuration. (#12076)

Add documentation to .h file.

Co-authored-by: stack <stack@duboce.com>

* Add a quickstart section on the bulkdump/bulkload feature to the user doc. (#12090)

* Fix assertion failure in fdbcli (#12095)

* Add Option to Turn Off Failure Injection to BulkLoad Process (#12096)

* add option to turn off failure injection to bulkload process in simulation

* nit

* DD BulkLoadTask Load Balance (#12103)

* bulkload load balance

* improve bulkload task submission efficiency

* address comments

* address comments

* cleanup

* Take a --proxy argument as backup_agent does. (#12110)

* Add "--proxy" to fdbserver (#12109)

* add --proxy to fdbserver

* fmt

* address comments

* use g_network to store proxy for s3client_ci

* Add 'ls' to s3client for the case where 'aws s3' is not installable (#12118)

* Add 'ls' to s3client for the case where 'aws s3' is not installable
-- i.e. production -- and we want a tool to test s3 connectivity.

Use it like this:

~/build_output/bin/s3client \
  --tls-ca-file /etc/ssl/cert.pem \
  --blob-credentials /path/to/credentials.json \
  ls "blobstore://backup-us-west-2.s3.amazonaws.com/x?bucket=backup-us-west-2&region=us-west-2"

* fdbclient/S3BlobStore.actor.cpp
* fdbclient/include/fdbclient/S3BlobStore.h
 Make constructResourcePath method on endpoint so accessible making ls
 URLs. Handling for encoded ampersands too. Allow 404 when requesting
 resource that doesn't exist.

* fdbclient/S3Client.actor.cpp
* fdbclient/S3Client_cli.actor.cpp
 Add in ls implementation.

* fdbclient/tests/s3client_test.sh
 Add test for new ls facility.

* See if this fixes compile issue

---------

Co-authored-by: michael stack <stack@duboce.com>

* Ingest sst files rather than their keyvalue content (2nd attempt) (#12108)

* Ingest sst files rather than their keyvalue content.

* fdbclient/ServerKnobs.cpp
* fdbclient/include/fdbclient/ServerKnobs.h
 Add BULK_LOAD_USE_SST_INGEST knob.

* fdbclient/include/fdbclient/IKeyValueStore.actor.h
 Add ingestSSTFiles and supportSStIngestion.

* fdbserver/KeyValueStoreRocksDB.actor.cpp
* fdbserver/KeyValueStoreShardedRocksDB.actor.cpp
 Implement ingestSSTFiles and supportSStIngestion

* fdbserver/storageserver.actor.cpp
 If BULK_LOAD_USE_SST_INGEST and BulkLoadType::SST, ingest sst file
 rather than read keyvalues.

* fdbclient/tests/fdb_cluster_fixture.sh
 Use rocksdb instead of sqllite in tests.

* Revert "Ingest sst files rather than their keyvalue content."

This reverts commit 6d50bf15d3566de17fa6febf2afba0f220846ca6.

* ctests pass

* Restore ingest minus metric

* Add back ingestDuration metric

* Formatting

---------

Co-authored-by: michael stack <stack@duboce.com>

* Allow resource to be empty (#12129)

* RocksDB Do Compact After BulkLoad (#12130)

* rocksdb bulkload compact after load

* address comments

* address comments

* job overwrite task root path (#12138)

* BulkLoad Load Balance Based on DataMove Busy Map  (#12137)

* bulkload load balance in ddqueue

* cleanup

* address comments

* nit

* bug fix

* nit

* address comments

* avoid scheduler busy loop

* address comments

* address comments

* avoid busy loop (#12157)

* First set of fixes... sizes and implement deleteResource (#12156)

Co-authored-by: michael stack <stack@duboce.com>

---------

Co-authored-by: Michael Stack <saintstack@users.noreply.github.com>
Co-authored-by: stack <stack@duboce.com>
2025-05-19 14:42: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 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
neethuhaneesha 62cc2a3edf
Migration to consider wiggling based on perpetualStorageEngine and not on configureStorageEngine (#11917) 2025-02-12 11:25:16 -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
neethuhaneesha 06cdf2e030
Pause store wiggle if all SS does not have minimum available space. (#11905) 2025-01-24 17:29:23 -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
Yao Xiao 6ccfbf2f42
Pause perpetual storage wiggle when TSS count target is met. (#11823)
* TSS pause

* Add condition
2024-12-16 11:36:37 -08:00
Zhe Wang ab9ce0df15
Cherrypick recent DD changes from release-7.3 (#11754)
* [Release-7.3] TeamRedundant and TeamUnhealthy data moves choose best destination with probability (#11668)

* team redundant and unhealthy data moves can choose best dest with probability

* nits

* nits

* enable wantTrueBestIfMoveout

* fix getteam stuck

* [Release-7.3] Delay team remover when space pivot is low (#11665)

* [Release-7.3] Validate ServerTeam count per server in simulation (#11678)

* validate server team count in simulation

* change naming (not relevant to the PR title)

* address comments and add a new trace event BuildTeamsLastBuildTeamsFailed triggered when buildTeam failed
2024-11-05 18:52:40 -08:00
Syed Paymaan Raza c146ee0869
[fdbserver] Use STL contains method and std::find for containment checks (#11702) 2024-10-15 11:40:02 -07:00
Syed Paymaan Raza c3e7542cda Update end year in copyright header 2024-08-02 09:40:11 -07:00
Zhe Wang 0b3bc71689
Fix TraceTooManyLines in BulkLoading Simulation Test (#11531)
* fix-trace-too-many-lines-bulkload-test

* mute PeerHealthMonitor

* address comments
2024-07-26 17:47:34 -07:00
Zhe Wang 74990e44bd
Bulk Loading Framework (#11369) 2024-07-23 14:57:28 -07:00
Zhe Wang aaabbedcc4
fix ss queue rebalance (#11375) 2024-05-08 09:35:42 -07:00
Yao Xiao 81b342fccd
Don't remove team when total team count is within threshold (#11295) 2024-04-19 15:40:42 -07:00
neethuhaneesha c89074ab04
Revert "Added perpetualStorageWiggleSpeed check to pick perpetualStoreType (#…" (#11305)
This reverts commit 3f5b60f711.
2024-04-17 10:09:38 -07:00
Hao Fu 2a774d39a5
Suppress ChosenMachine to fix simulation error (#11277) 2024-04-03 17:26:22 -04:00
neethuhaneesha 3f5b60f711
Added perpetualStorageWiggleSpeed check to pick perpetualStoreType (#11272) 2024-04-01 11:30:18 -07:00
neethuhaneesha 77ff238874
Fixing setting perpetual_storage_wiggle_engine is considered as wrongly configured (#11250) 2024-03-14 11:52:29 -07:00
He Liu 93a9849c0f Merge branch 'main' of https://github.com/apple/foundationdb into fix-dd-race-condition 2024-02-26 14:34:36 -08:00
He Liu 9efbcdb314 Don't treat SS as failed when ignoreSSFailure is set. 2024-02-22 13:16:34 -08:00
Johannes M. Scheuermann 484c5deaf0 Allow to disable the removal of maintenance mode when a SS outside of the maintenance zone fails 2024-02-22 18:29:20 +01:00
Zhe Wang 9c795c5f52
fix calculateTeamStorageQueueThreshold (#11196) 2024-02-12 16:19:33 -08:00
Zhe Wang b699a7e4f7
Write-Traffic-Aware Load Balancer (#11189)
* write traffic aware load balancer

* address comments

* address comments
2024-02-11 15:05:41 -08:00
Zhe Wang 09444c7657
Rebalance Storage Queue (Cherrypick from release-7.1) (#11172)
* cherry-pick-storage-queue-rebalance

* address comments

* address comments
2024-02-07 13:14:08 -08:00
Dimitris Apostolou a88114c222
Fix typos 2024-02-07 01:16:00 +02:00
Zhe Wang 970175a8a2
cherrypick storage queue aware getteam (#11154) 2024-01-30 15:15:18 -08:00
chuang he 64b01298b2 Fix healthyzone is not modified when ignoressfailuers is set
Signed-off-by: chuang he <hechuang@xsky.com>
2024-01-15 16:27:07 +08:00
Yao Xiao 83e1f8ab7b
Logging improvement. (#11084) 2023-12-01 16:13:17 -08:00
neethuhaneesha 361af9e862
Perpetual wiggle option to have multiple SS in rebalance state during wiggling. (#11019) 2023-10-24 15:10:51 -07:00
Zhe Wang 4695bdfbbf
improve printSnapshotTeamsInfo (#10999) 2023-10-23 08:54:07 -07:00
neethuhaneesha ca2700cc35
Erase storageWiggleID from disk if not used (#10912) 2023-09-22 14:15:06 -07:00
Zhe Wu 87083652a3
Merge pull request #10856 from halfprice/zhewu/wiggle-locality-list
Make `perpetual_storage_wiggle_locality` database option to take a list of localities
2023-09-20 15:42:25 -07:00
Zhe Wu d65a6a8a10 Address comments 2023-09-20 13:56:15 -07:00
Zhe Wu 31d46b6fb2 Address comments 2023-09-19 10:35:51 -07:00
Jingyu Zhou 12fe500633 ClusterController watches changes to storage metadata
To retrieve storage metadata for every status json request is very expensive
for clusters with a large number of storage servers. So I change the logic so
that ClusterController actively monitors changes to storage metadata, and only
retrieves them when there is a change.
2023-09-15 14:19:04 -07:00
Zhe Wu bebd1790db Resolve conflict with recent change in main 2023-09-13 14:28:21 -07:00
Zhe Wu af42816b0e Adding test for perpetual_storage_wiggle_locality to take a list of localities 2023-09-13 13:36:16 -07:00
Zhe Wu a86a2d752e Apply format 2023-09-13 13:36:16 -07:00
Zhe Wu 7158d702c6 Use locality list for host checking 2023-09-13 13:36:16 -07:00
Zhe Wu 4abd2edcad Parse wiggle locality as a list 2023-09-13 13:36:16 -07:00
neethuhaneesha 9bafef4fd2 Locality check on perpetualStorageWiggleIDPrefix when DD restarts 2023-09-06 16:00:32 -07:00
Zhe Wu e2f5c50a7b
Merge pull request #10828 from halfprice/zhewu/clear-wiggle-storage-engine
Add option to set perpetual_storage_wiggle_engine to none
2023-09-05 11:06:21 -07:00
Zhe Wu 6610a228c7 Add option to set perpetual_storage_wiggle_engine to none 2023-08-24 13:43:58 -07:00
Yao Xiao 0a87b6039f
Add perpetual wiggle pause reason. (#10821) 2023-08-24 00:31:38 -07:00
Zhe Wang f8311ae069
Add more trace event for TSS recruitment (#10809)
* add more trace event for tss

* update StorageServerInitProgress

* add more traces
2023-08-23 09:19:30 -07:00
Zhe Wang 83dc9ff6f7
Trace SS init progress (#10799)
* trace ss init progress

* improve trace events
2023-08-18 18:44:37 -07:00