Commit Graph

50 Commits

Author SHA1 Message Date
Trevor Clinkenbeard c1d388a06f
Merge pull request #13770 from tclinkenbeard-oai/dev/tclinkenbeard/foundationdb-complexity-simplifications-20260722
Reduce duplicated logic
2026-07-31 14:22:25 -07:00
Johannes Scheuermann 5ce16e8e1e
DD maintenance duration observability (#13767)
* Add maintenance mode duration information to trace events

* Persist start time to provide the correct duration if DD gets restarted or re-recruited
2026-07-31 19:33:05 +02:00
Trevor Clinkenbeard 20241eefbd Merge origin/main into complexity simplifications branch 2026-07-30 11:42:18 -07:00
Trevor Clinkenbeard a42a354b0d Adjust code probe rarity to match simulation coverage 2026-07-22 10:28:11 -07:00
Trevor Clinkenbeard c0fc45a38c Reuse existing team lookup when building emergency teams 2026-07-22 09:55:51 -07:00
Trevor Clinkenbeard 03de67c336 Make Data Distributor implementation headers private 2026-07-15 10:04:40 -07:00
Trevor Clinkenbeard ed7e102a9b Merge remote-tracking branch 'origin/main' into dev/tclinkenbeard/remove-mock-dd-e2e 2026-07-14 22:31:24 -07:00
Trevor Clinkenbeard 7f8b84d41d Remove MockDD end-to-end emulation 2026-07-12 10:54:57 -07:00
Trevor Clinkenbeard bb1be95f92 Apply clang-format to recruitment cooldown change 2026-07-10 16:53:36 -07:00
Trevor Clinkenbeard c2278fd01f Release failed recruitment IDs during backoff 2026-07-10 16:46:01 -07:00
Trevor Clinkenbeard 3d9a96951d Stop counting rejected storage recruitment during backoff 2026-07-10 15:08:18 -07:00
Trevor Clinkenbeard 648f42563a Merge remote-tracking branch 'origin/main' into dev/tclinkenbeard/move-process-class
# Conflicts:
#	fdbrpc/include/fdbrpc/Locality.h
#	fdbserver/clustercontroller/ClusterController.h
#	fdbserver/core/LeaderElection.cpp
2026-07-08 09:39:05 -07:00
Trevor Clinkenbeard e5bef00adb
Merge pull request #13404 from tclinkenbeard-oai/dev/tclinkenbeard/datadistributor-private-headers
Make `TCInfo.h` private in `fdbserver/datadistributor`
2026-07-07 16:39:22 -07:00
Trevor Clinkenbeard 0c7f483060 Initialize endpoints in DD team collection tests 2026-06-28 13:12:54 -07:00
Trevor Clinkenbeard 559caa1fa1 Make TCInfo private to datadistributor 2026-06-28 13:01:20 -07:00
Trevor Clinkenbeard 591747d7e5 Move process class recruitment policy into fdbserver 2026-06-25 18:54:14 -07:00
Trevor Clinkenbeard 72d5e13f2e Clean up boolean comparisons 2026-05-21 12:25:08 -07:00
Syed Paymaan Raza 534ac1f84c
Make getTeamByServers O(1) in time (#12938) (#13012)
* Make getTeamByServers O(1) in time (#12938)

* Make getTeamByServers O(1) in time

* address feedback

* address feedback
2026-05-19 14:12:31 -07:00
Trevor Clinkenbeard 73a5716c90 Apply clang-format to makeReference cleanup 2026-05-09 13:24:59 -07:00
Trevor Clinkenbeard d7f1bdc66f Prefer makeReference for polymorphic references 2026-05-09 13:13:05 -07:00
Michael Stack 09d67f918e
Add DD init visibility, metrics retries, shard tracking, scan progress, and team collection logging (#12913) (#13142)
* Add DD init and team collection logging for diagnosing slow startups

When SHARD_ENCODE_LOCATION_METADATA=true we take new codepaths often
opaque. Add logging.

For example, DD init hung for 14-16 minutes with zero visibility into
what was stuck. The only clue was a gap between DDInitUpdatedReplicaKeys
and DDInitGotInitialDD trace events.  Diagnosing the root cause required
extensive log splunking of SS metrics to determine that a single
getRange(dataMoveKeys) read was queued on an overloaded storage server.

DDTxnProcessor.actor.cpp:
- Log elapsed time for the server list + data move read transaction
  (DDInitServerListAndDataMoveReadComplete) with NumDataMoves, NumServers
- Log elapsed time for the keyServer scan (DDInitKeyServerScanComplete)
  with NumShards
- Warn when getRange(dataMoveKeys) takes >5 seconds
  (DDInitSlowDataMoveRead)

DataDistribution.actor.cpp:
- Add NumShards and NumServers to DDInitGotInitialDD
- Promote DDInitFoundDataMove from SevDebug to SevInfo so individual
  data moves are visible in production logs
- Add DDInitResumedDataMoves summary event with ValidMoves,
  CancelledMoves, EmptyMoves counts and elapsed time

DDTeamCollection.actor.cpp:
- Add Reason and Address details to UndesiredStorageServer trace events
  to distinguish version lag, same-address, wrong-class, and exclusion
  causes without needing to correlate with other log lines

* Revert DDInitFoundDataMove to SevDebug to avoid log spam with many data moves

* Add DD startup visibility: metrics retries, shard tracking, scan progress

Additional logging to address DD operational opacity during startup,
based on past incidents where DD hung with no visibility into the cause.

NativeAPI.actor.cpp:
- Log WaitStorageMetricsRetrying every 60s when waitStorageMetrics is
  stuck retrying wrong_shard_server or all_alternatives_failed, with
  the key range, retry count, and elapsed time. Previously these retries
  were silent (SevDebug only), making it impossible to identify which
  shard was stuck or that retries were even happening.

DDShardTracker.actor.cpp:
- Log TrackInitialShardsComplete after shard tracker setup with count
- Log TrackInitialShardsMetricsComplete after changeSizes() finishes
  with elapsed time. changeSizes() waits for ALL shards to report
  metrics via getFirstSize/waitStorageMetrics -- if any shard metrics
  never arrive, this hangs silently.

DDTxnProcessor.actor.cpp:
- Log DDInitKeyServerScanProgress every 30s during the multi-transaction
  keyServer scan with current beginKey, batch count, shards scanned,
  and elapsed time. With 255K shards this scan requires many transactions
  and a stuck one was previously invisible.

DataDistribution.actor.cpp:
- Log DDInitComplete with elapsed time after DataDistributor::init()
  finishes, providing a single event showing total init duration.

- NativeAPI.actor.cpp: Move retry logging outside the error-type if block
  so all errors get keys/elapsed/retries details. Use severity upgrade
  (SevDebug -> SevWarn after 60s) on the existing WaitStorageMetricsHandleError
  event instead of a separate event name.
- DataDistribution.actor.cpp: Add periodic progress logging (every 30s) in
  resumeFromDataMoves loop so operators can watch counts go up during long
  data move recovery.
- CompileBoost.cmake: Remove BOOST_NO_CXX98_FUNCTION_BASE since 7.3 CI is
  broken independently of this change.

DD exits (e.g. movekeys_conflict) were invisible because
reportErrorsExcept suppresses logging for "normal" DD errors.
Add DDExiting trace event at SevWarn with error and code so
every DD death is visible in trace logs.
2026-05-05 14:17:09 -07:00
gxglass 1f62390883
Add counters for DD and MoveKeys transactions (PR #13062 forward-ported to main) (#13101)
See PR #13062.

This has been refactored a bit compared to the code on the maintenance branches to reduce boilerplate.

* Applied SimpleCounter transaction instrumentation to 20 DD and MoveKeys functions across 4 files, matching the diff in /tmp/pr13097.diff. The 3 missing counters are for waitFailCacheServer which was deleted from the codebase

* reduce boilerplate relating to counters
2026-04-29 17:10:36 -07:00
Trevor Clinkenbeard 644d6bca94
Merge pull request #13100 from tclinkenbeard-oai/dev/tclinkenbeard/dd-team-collection-coro
Convert several `DDTeamCollection.actor.cpp` actors to standard coroutines
2026-04-29 16:13:44 -05:00
Trevor Clinkenbeard e1025a7993
Merge pull request #13080 from tclinkenbeard-oai/dev/tclinkenbeard/move-simulator-up
Move FDB-specific logic out of `ISimulator`
2026-04-28 16:52:22 -05:00
Trevor Clinkenbeard 7b004ad2ab Document exclusion address checks 2026-04-28 08:45:07 -07:00
Trevor Clinkenbeard 8a03fcefa6 Fix isr initialization 2026-04-28 04:59:39 +00:00
Trevor Clinkenbeard edf7b6848b Convert initializeStorage to standard coroutine 2026-04-28 04:45:54 +00:00
Trevor Clinkenbeard f60ed1f9da Convert buildTeams to standard coroutine 2026-04-28 04:41:19 +00:00
Trevor Clinkenbeard 5aae47c123 Convert monitorHealthyTeams to standard coroutine 2026-04-28 04:30:33 +00:00
Trevor Clinkenbeard 8dc88c342a Convert perpetualStorageWiggleIterator to standard coroutine 2026-04-28 04:25:51 +00:00
Trevor Clinkenbeard 6f5a0ea80d Convert DDTeamCollectionImpl::interruptableBuildTeams to standard coroutine 2026-04-28 04:12:14 +00:00
Trevor Clinkenbeard 8b3d03c8bf Merge remote-tracking branch 'apple/main' into dev/tclinkenbeard/move-simulator-up 2026-04-25 00:14:13 +00:00
Trevor Clinkenbeard b45b1e6c19 Next iteration of shrinking ISimulator 2026-04-25 00:08:38 +00:00
Trevor Clinkenbeard f091476969 Fix DDTeamCollection trace event field names 2026-04-24 11:51:11 -07:00
Trevor Clinkenbeard 94ceb46dc8 Make (CLIENT|SERVER)_KNOBS direct global pointers 2026-04-02 10:31:18 +00:00
Trevor Clinkenbeard d272fc770b Add FDB_BOOLEAN_PARAMs in DDTeamCollection.h 2026-03-28 10:56:26 +00:00
Trevor Clinkenbeard 38b05e51cd Post coroutine conversion linting 2026-03-25 16:31:16 -07:00
Michael Stack 8868828c9a
Fix BUGGIFY version explosion in CycleRollbackClogged simulation test (#12839)
The BUGGIFY block in readTransactionSystemState() adds up to 10M random
versions to recoveryTransactionVersion on each recovery. This is intended
to test the scenario where an offline cluster comes back online with a
large version jump. However, it fires on every recovery, and each
inflated version gets persisted to coordinated state via the TLog end
version. The next recovery reads it back via oldLogSystem->getEnd() and
inflates it again. In tests with rapid recovery loops
(Rollback+Clogging+Attrition), this compounds across dozens of
recoveries to 20+ billion versions, producing 461MB trace files and
eventually crashing the simulation.

Fix: Guard the BUGGIFY inflation with oldTLogData.empty() so it only
fires on the first generation (no previous TLog data). This matches the
intended test scenario (offline cluster restart) without allowing
compound growth across rapid re-recoveries.

Also add suppressFor() to high-frequency trace events in
DDTeamCollection and ConsistencyCheckUrgent that fire at extreme rates
during recovery churn, contributing to trace file bloat and OOM crashes.

Co-authored-by: stack <stack@duboce.com>
2026-03-24 07:50:42 -07:00
Trevor Clinkenbeard f60bda3cb1 Remove unnecessary hasErr flags 2026-03-23 22:48:10 +00:00
Trevor Clinkenbeard ae64a82e33 Remove unnecessary braces 2026-03-23 22:35:53 +00:00
Trevor Clinkenbeard d5e0e486cd Remove unnecessary trailing co_return statements 2026-03-23 14:47:02 +00:00
Trevor Clinkenbeard ed80a7df61 Rename files 2026-03-23 14:40:13 +00:00
Trevor Clinkenbeard f38e6b5a57 Revert coroutine conversions causing correctness issues 2026-03-23 14:35:47 +00:00
Trevor Clinkenbeard 26693c0b53 Fix build 2026-03-23 14:35:47 +00:00
Trevor Clinkenbeard 2589ffcc74 Convert more fdbserver/datadistributor actors to standard coroutines 2026-03-23 14:35:47 +00:00
Trevor Clinkenbeard e6e983fd0f Make more header file private 2026-03-16 15:47:02 +00:00
Trevor Clinkenbeard c9ebb2db56 Merge remote-tracking branch 'apple/main' into dev/tclinkenbeard/modularize-fdbserver2 2026-03-15 22:24:53 +00:00
Trevor Clinkenbeard 1addd80128 Merge remote-tracking branch 'origin/main' into dev/tclinkenbeard/modularize-fdbserver2 2026-03-13 13:39:10 -07:00
Trevor Clinkenbeard 39beb1c732 Remove role library dependencies on fdbserver 2026-03-12 23:20:54 +00:00
Trevor Clinkenbeard f7f1116e24 Create fdbserver/datadistributor library 2026-03-12 19:51:09 +00:00