Commit Graph

859 Commits

Author SHA1 Message Date
michael stack ac41ec01f6 Backport: add retry limit to startMoveKeys to prevent infinite loops (PR 13176)
Add START_MOVE_KEYS_MAX_RETRIES knob (default 50, BUGGIFY=10) and throw
start_move_keys_too_many_retries when exceeded. Wire the new error into
DDRelocationQueue (same light-weight re-queue handler as
finish_move_keys_too_many_retries and move_to_removed_server) and
normalDDQueueErrors so DD does not restart. Also propagate actor_cancelled
before the retry limit check in startMoveKeys.
2026-07-23 16:46:02 -07:00
gxglass 12ec997d03
Backport DD pipeline saturation test + gate-all-priorities (PR 13381) (#13411)
Ports apple/foundationdb#13381 to release-7.4:

- DDRelocationQueue: the relocation pipeline gate now holds moves of all
  priorities when the pipeline is full; only cancellations bypass (they
  reduce tracked metadata rather than add to it). Previously moves with
  priority >= PRIORITY_TEAM_UNHEALTHY passed through unconditionally. Add a
  "DD Pipeline Full" CODE_PROBE where pipelineFull is set.
- ServerKnobs: raise the buggified DD_MAX_PIPELINE_MOVES from 5 to 20 so
  simulation does not test under artificial scarcity (degenerate cases).
- Add fast/DDPipelineSaturation.toml, which saturates the back-pressure
  gate via many small shards plus failure-recovery relocations and trips
  the new code probe.

Paths adapted from main's layout (fdbserver/core, fdbserver/datadistributor)
to release-7.4 (fdbclient/ServerKnobs.cpp, fdbserver/DDRelocationQueue.actor.cpp);
the BUGGIFY macro is retained.

Testing: Release build; ran fdbserver -r simulation on DDPipelineSaturation
across several seeds, buggify on and off. The gate change is behaviorally
inert in these runs -- a baseline binary with the priority condition restored
produces bit-identical transaction counts and there are no SevError events --
and the "DD Pipeline Full" code probe is hit every run. The test currently
trips the Cycle workload's "Rate below desired rate" check because this branch
still carries the Cycle minimum-rate check that main removed in #13297; it
passes once that check is gone. Joshua validation deferred until the #13297
backport is sequenced onto the branch.
2026-07-07 16:44:08 -07:00
neethuhaneesha 164d2e7aed
Add ROCKSDB_ENABLE_CACHE_USAGE_OVERRIDES knob for charging few memory usage fields under block cache (#13346) 2026-06-15 16:43:27 -07:00
gxglass cf6046297a
port PR #13243 to release-7.4 branch from release-7.3 branch. DD admission control related. (#13280)
Originally this was PR #13112. That was ported to release-7.3 as PR #13243. Since release-7.4 is closer to release-7.3 than to main, port 13243 to release-7.4.
2026-05-28 11:51:09 -07:00
Syed Paymaan Raza 615ae191a2
Make getTeamByServers O(1) in time (#12938) (#13012) (#13244)
* Make getTeamByServers O(1) in time (#12938)

* Make getTeamByServers O(1) in time

* address feedback

* address feedback
2026-05-21 14:14:12 -07:00
Michael Stack 14de1de30e
Forward-port: DD 7.3 finish movekeys backoff (#12991) to 7.4 (#13145)
* DD 7.3 finish movekeys backoff (#12991)

* Add jitter to finishMoveKeys backoff

Jitter the exponential backoff delay to [0.75x, 1.25x] of the base
value. This prevents all 15 FlowLock slots from retrying in lockstep
when they all hit transaction_too_old at the same time.

* Cap finishMoveKeys backoff at 5s after jitter

Apply the 5.0s cap after jitter so the final delay never exceeds
the documented maximum.
2026-05-12 09:27:53 -07:00
gxglass beca024943
Forward port PR #13068 to release-7.4 (async status related) (#13099)
It might have been easier to backport PR #12940 from main directly to release-7.4.

* Backport PR #12940 to release-7.3 (async status related) (#13068)

* 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.

* formatting

* Fix some misc backporting related issues

* Fix build for async status backport: remove tenant stuff, grey failure stuff, and update includes

* formatting

* remove dead code found in subsequent review

---------

Co-authored-by: Han Xu <hgcrpd@gmail.com>

* fix merge damage

* fix some more merge damage

* formatting

---------

Co-authored-by: Han Xu <hgcrpd@gmail.com>
2026-04-29 13:56:30 -07:00
neethuhaneesha 31fd069431
Disable rocksdb caching based on ReadOptions.cacheResult (#13061) 2026-04-28 23:10:57 -07:00
gxglass 9aaa5222f8
latency tracking for dataDistributionRelocator (#13072) (#13103)
Cherrypick PR#13072 into release-7.4.

This function does a lot of stuff and has been observed to be expensive from time to time. This PR tracks its latency explicitly. This is done in 5 minute windows which seems about the right granularity for the sort of incidents which we might anticipate. Note too short, not too long.

Testing (7.4 specific):
20260428-142636-gglass-3b52791173c99235 compressed=True data_size=41487471 duration=4813496 ended=100000 fail_fast=1000 max_runs=100000 pass=100000 priority=100 remaining=0 runtime=1:00:16 sanity=False started=100000 stopped=20260428-152652 submitted=20260428-142636 timeout=5400 username=gglass

* latency tracking for dataDistributionRelocator (#13072)

* add latency tracking for dataDistributionRelocator

* simplify approach, and try to avoid negative latency samples

* formatting
2026-04-28 16:10:52 -07:00
neethuhaneesha 0e6bbf2af8
Removed no-op mode in BackupWorker (#12748) 2026-03-04 13:24:42 -08:00
Syed Paymaan Raza d20a925e12
(7.4 Backport) Rename CC_ENABLE_REMOTE_LOG_ROUTER_MONITORING to CC_ENABLE_REMOTE_LOG_ROUTER_DISCONNECT_MONITORING (#12369)
* Rename CC_ENABLE_REMOTE_LOG_ROUTER_MONITORING to CC_ENABLE_REMOTE_LOG_ROUTER_DISCONNECT_MONITORING

* Fix spacing
2025-09-15 21:06:14 -07:00
gxglass ff19220787
SimpleCounter implementation and application to Arena, FastAlloc, and Net2 cherrypick to 7.4 (#12372)
* Arena/FastAlloc: add comments where potential metrics can be added (#12306)

* Arena/FastAlloc: add comments where potential metrics can be incremented.
The intent is to count allocations and bytes.

Remove a commented-out ifdef block that has been disabled for many years and
which does not work (per the explanation in the comment).  We don't need to
keep reading about the results of a small failed experiment from many years ago.

* add more one FIXME comment

* add one more METRICS-FIXME

* Add a SimpleCounter template for counter metrics (#12326)

* ignore TAGS (from etags/ctags)

* Add initial SimpleCounter interface/implementation/unit tests

* Add initial SimpleCounter interface/implementation/unit tests

* Fix unit test

* Improve clarity on unit test

* Update FIXME comments

* Address review comments.  Must use function local static mutex

* update comment

* Go back to template specializations to handle older C++ versions

* SimpleCounter: periodically log the counters to TraceEvent (#12329)

* SimpleCounter: periodically log the counters to TraceEvent.  Muck with hierarchical names to comply with random rules.

* Update doc about Prometheus metric names

* relax assertion about counter count, because unit test is actually running in fdbserver and that causes a unrelated counter to be created

* Update SimpleCounter unit tests not to use metric names that break Trace.cpp simulation-only checks (#12333)

* Add a pointed comment in UnitTest.h about some weaknesses

* Use counter names that will get converted to field names that TraceEvent does not complain about

* unit test: do not use a counter name that will cause Trace.cpp to emit errors in simulation

* update comment about caveats with unittests breaking simulation

* yet another field name fix

* just call validateField() directly from simple counters

* run report loop in unit tests

* fix build, fix comment

* blah blah blah

* always be munging metric names

* Instrument Arena, FastAlloc, Platform.cpp with SimpleCounter metrics to count allocations and bytes (#12339)

* emit a simpleCounterReport when we declare out of memory

* FastAlloc.h: initial pass of adding byte/object allocation/deallocation metrics

* Avoid conflict over the name SimpleCounter by eliminating this private definition of a name which is too valuable for this one random file to claim for its own use

* FastAlloc.cpp, Platform.actor.cpp: initial pass at adding SimpleCounter metrics to count allocations and bytes

* rename wrapper calls and update comments

* Count bytes copied in StringRef

* Arena.cpp: instrument allocations and some other stuff

* Arena.cpp: simplify use of SimpleCounter

* simpleCounterReport: generate TraceEvent in batches of MAX_TRACE_EVENT_LENGTH / 100 counters to avoid trace buffer overflow

* Eliminate poorly motivated trace field name validation, and change SimpleCounter to emit Prometheus-compatible metric names (#12356)

Trace.cpp does not provide a rationale for validateField() and validateFormat(). It appears to be some kind of
XML related validation. Why we should care about this is not clear. The output is going to Splunk. As far as I know, Splunk is supposed to be pretty liberal in what it accepts as input.

Add logic in SimpleCounter.cpp to convert hierarchical metric names to Prometheus compatible metric names
by the simple rule of converting intermediate '/' chars into '_', i.e. something like /flow/arena/bytesAllocated becomes
flow_arena_bytesAllocated. I feel hierarchical names are still slightly better, and very easy to reason about when
creating new metric names on the fly, but ensuring that they are at least Prometheus compatible should allow targeting
to future metrics platforms down the road.

Testing:
20250905-010257-gglass-25f3ef43ccc1c130 compressed=True data_size=41538755 duration=6389116 ended=100000 fail_fast=10 max_runs=100000 pass=100000 priority=100 remaining=0 runtime=1:00:34 sanity=False started=100000 stopped=20250905-020331 submitted=20250905-010257 timeout=5400 username=gglass

* replace undocumented trace event field name rules with a rule that enforces that field names must be valid Prometheus metric names. No idea why the old code declines to even state what it is trying to be compatible with

* move Prometheus metric name validation to SimpleCounter.cpp.  Remove validation from Trace.cpp.  This stuff is going to Splunk.  Splunk takes what we give it.

* Use simple counter to replace recently added net2 counters (#12358)

* use simple counter to replace recent added net2 counters

* allow unit test to use SimpleCounter Trace event

---------

Co-authored-by: Zhe Wang <zhe.wang@wustl.edu>
2025-09-15 17:07:07 -07:00
neethuhaneesha 12cad5eb45
Rocksdb knobs (#12361) 2025-09-08 17:49:47 -07:00
Zhe Wang 99923077f6
[Release-7.4] Cherrypick Mitigate rocksdb external timeout in AtomicBackupToDBCorrectness test (#12193) 2025-06-17 11:49:12 -07:00
Zhe Wang f60e95c50b
[Release-7.4] Cherry-pick Avoid Source Storage Server Being Overloaded by Data Movements with Replica Consistency Check (#12176)
* 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

* remove taskID in get range requests
2025-06-02 12:34:34 -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
Syed Paymaan Raza a7c536e2ab
Disable ENABLE_REPLICA_CONSISTENCY_CHECK_ON_DATA_MOVEMENT by default, randomly enable in simulation (#12136) 2025-05-09 15:39:34 -07:00
Jingyu Zhou 1693a718ae
Fix assertion failure due to small knob value (#12114)
Increase the buffer size for backup workers and rename the knob.

Seed: -f ./tests/slow/ParallelRestoreNewBackupCorrectnessAtomicOp.toml -s 3120109021 -b on
2025-04-29 14:22:47 -07:00
neethuhaneesha 3b98e53c70
Limit the number of clearRanges per commit to a knob value only for rocksdb storage engine and added few metrics. (#12054) (#12062) 2025-04-01 21:38:09 -07:00
Zhe Wang a345d66ec3
A Couple of Fixes and Improvements for BulkLoad/Dump (#12040) 2025-03-19 09:00:36 -07:00
Zhe Wang 0e736c68e7
Allow One BulkloadTask Do Multiple Manifests (#12036) 2025-03-17 11:45:15 -07:00
Zhe Wang d5946157f0
avoid shard merge when bulkload (#12035) 2025-03-15 13:20:51 -07:00
neethuhaneesha 1d9f16bf07
Added compaction knobs. (#12018) 2025-03-12 12:38:23 -07:00
Zhe Wang 51ad8428e0
A Couple for Fixes for BulkDump and RangeLock (#12013)
* fix lockrange test and improve bulk dump

* fix bulkdump stuck error

* remove unnecessary yield when read/write bulk files

* remove unnecessary string creation in read/write bulk files
2025-03-11 15:58:01 -07:00
Syed Paymaan Raza 610ab21936 Increase TLOG_MAX_CREATE_DURATION in simulation 2025-03-10 19:47:23 -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
Jingyu Zhou add710d7f6
Enable TRACK_TLOG_RECOVERY as default (#11987)
Test RECORD_RECOVER_AT_IN_CSTATE and TRACK_TLOG_RECOVERY in buggify with random
on or off.
2025-03-02 19:15:12 -08:00
Zhe Wang 2116547ad3
Improve BulkDump Implementation (#11974)
* bulkdump code refactor

* fix bugs

* improve
2025-02-26 13:58:45 -08:00
Yao Xiao 67b9b5c9f3
Remove per thread histogram in storage engine and fix bugs in range scan. (#11967) 2025-02-25 10:52:46 -08:00
Yao Xiao 76d514bf56
Update shared rocksdb knobs. #11936 (#11938) 2025-02-11 15:41:02 -08:00
Zhe Wang d1efff1511
Improve BulkLoad Implementation (#11929)
* improve bulkload code

* address CI

* disable audit storage replica check and distributed consistency check in bulkload and bulkdump simulation test

* fix ci

* disable waitForQuiescence in bulkload and bulkdump tests
2025-02-06 21:25:49 -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
Zhe Wang b0ff9187ad
fix shardedrocksdb knob and add ENFORCE_SHARDED_ROCKSDB_SIM_IF_AVALIABLE (#11916) 2025-01-29 23:40:37 -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
Yao Xiao 786e2a6093 Add custom compaction policy based on number of range deletions in file
* compaction policy

* fix build error
2025-01-17 14:14:14 -08:00
Yao Xiao 9ca82b2fda Add knob for direct IO 2025-01-17 14:11:35 -08:00
neethuhaneesha f4c3565aff
Rocksdb manual flush code changes (#11849) 2025-01-17 12:44:44 -08:00
Dan Lambright 78d4490acf
Add ENABLE_VERSION_VECTOR_REPLY_RECOVERY switch (#11889)
Co-authored-by: Dan Lambright <hlambright@apple.com>
2025-01-16 15:10:06 -05: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
Syed Paymaan Raza c2862b8728
Lower bound version of CC_DEGRADED_PEER_DEGREE_TO_EXCLUDE (#11840) 2024-12-18 23:33:01 -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 31cf800ef9 batch dumping at SS 2024-12-04 11:14:51 -08:00
Zhe Wang 86979abdb0 add parallelism check 2024-12-03 22:01:06 -08:00
Zhe Wang 3bc612e286 add bulkdump metadata and manifest 2024-12-03 22:01:06 -08:00
Zhe Wang 75f7693874 add SS bulkdump 2024-12-03 22:01:06 -08:00
Zhe Wang db8c7d96b8 add bulkdump mode and task scheduling in DD 2024-12-03 22:01:06 -08:00
Syed Paymaan Raza 5a615df85f
Make rocksdb deterministic in simulation (#11790) 2024-11-19 15:42:15 -08:00
neethuhaneesha 1f7a9f4768
Manual flush if the rocksdb flush does not happen within a time interval. (#11791) 2024-11-19 11:57:32 -08:00
neethuhaneesha 5be60d50d3
Histogram sample rate updated to 1. (#11793) 2024-11-19 11:53:16 -08:00