Commit Graph

30 Commits

Author SHA1 Message Date
Trevor Clinkenbeard 849b26f449 Fix GcGenerations timeout and retry coverage 2026-07-18 00:12:32 -07:00
Trevor Clinkenbeard 006dde8023 Fix GcGenerations clogged-master retry loop 2026-07-17 23:31:37 -07:00
Trevor Clinkenbeard e24ff6a620 Fix GcGenerations after region failover 2026-07-17 19:19:07 -07:00
Trevor Clinkenbeard 1f217f61d6 Retire recovered TLogs after recovery completes 2026-07-14 20:43:34 -07:00
Trevor Clinkenbeard 091aa15a2f Address clang-tidy warnings 2026-05-24 18:14:26 -07:00
Akanksha Mahajan 45373739c8
Fix simulation failure (#13170) 2026-05-07 15:01:37 -07:00
Trevor Clinkenbeard 2edff49627 Merge remote-tracking branch 'origin/main' into dev/tclinkenbeard/explicit-ctors
# Conflicts:
#	fdbrpc/include/fdbrpc/AsyncFileEncrypted.h
#	fdbserver/include/fdbserver/KmsConnector.h
#	fdbserver/workloads/DifferentClustersSameRV.cpp
#	flow/include/flow/TxnCounters.h
2026-05-02 15:01:26 -07:00
Trevor Clinkenbeard 79962f9b82 Move more fields out of ISimulator 2026-04-24 23:28:15 +00:00
Trevor Clinkenbeard 550ce20e9f Move fields out of ISimulator 2026-04-24 21:54:19 +00:00
Trevor Clinkenbeard 399d13505f Make single-argument constructors explicit 2026-04-24 18:53:40 +00:00
Trevor Clinkenbeard 49b70f196a Merge remote-tracking branch 'origin/main' into dev/tclinkenbeard/enforce-clang-tidy2 2026-04-17 16:38:58 -07:00
Michael Stack 2d8c0089c2
Fix GcGenerations test: block trackRecoveryReq when disableTLogRecove… (#12992)
* Fix GcGenerations test: block trackRecoveryReq when disableTLogRecoveryFinish is set

disableTLogRecoveryFinish only blocked TLogRecoveryFinishedRequest but
not TrackTLogRecoveryRequest. This allowed recoveredVersion to advance
and purgeOldRecoveredGenerationsCoreState to GC generations during the
accumulation phase, causing the test assertion to fire when oldTLogs
shrank instead of grew. Also fix the wait loop predicate to use <=
instead of == so it only exits on strict growth.

* Fix GcGenerations test: skip remote DC masters and cleanup on timeout

When the remote DC is clogged, the CC may recruit the master there.
Rebooting a remote DC master stalls recovery because it cannot
communicate with primary DC processes. Only reboot primary DC masters
and retry if the master is in the remote DC.

Add destructor cleanup so that if the workload times out, simulator
state (clog, connection failures, disableTLogRecoveryFinish) is
restored, preventing the Cycle workload check from failing on a
permanently degraded cluster.

Tested: 3 failures in 100k joshua runs (all pre-existing: 2x
TracedTooManyLines from waitForQuietDatabase hang, 1x LogRouter
segfault). Zero GcGenerations workload assertion failures.

* Formatting

* Revert <= back to == in generation wait loop

GC should not reduce oldTLogs.size() while disableTLogRecoveryFinish
is true, so the defensive <= check is unnecessary and could mask a
real problem.

* Add suppressFor(60) to WaitingToBeUnblocked trace event

Without suppression, each blocked TLog emits a trace line every 10s.
Across many TLogs and recovery generations this hits TracedTooManyLines
causing the process to abort, which is the source of the test timeouts
and SIGTERM failures (10 out of 19k runs).

* Reboot master after clearing disableTLogRecoveryFinish to unstick GC

The trackRecoveryReq blocking during generation accumulation prevents
TLogs from reporting their recovered state. After the flag is cleared,
the current recovery tracking is stale: FinalUpdate never fires because
the blocked TLogs missed their reporting window. Without FinalUpdate,
purgeOldRecoveredGenerationsCoreState never runs, and oldTLogs stays
at 15 forever.

Fix by rebooting the master after clearing the flag. The fresh recovery
starts with clean tracking state, all TLogs respond normally, FinalUpdate
fires, and generation GC proceeds.

* Fix peek cursor assertion crash and GC timeout in GcGenerations test

Two fixes for remaining GcGenerations test failures:

1. enableConnectionFailures instead of extendConnectionFailures:
   extendConnectionFailures only pushes out connectionFailureDisableTime
   without resetting connectionFailureEnableTime. After enough loop
   iterations, the peek cursor assertion window at
   LogSystemPeekCursor.actor.cpp:358 opens while clogged pairs are still
   active, causing ASSERT_WE_THINK crashes.

2. GC retry loop with rebootPrimaryMaster helper:
   Replace single master reboot + generationReduced wait with a loop that
   periodically reboots the master until oldTLogs.size() <= 1. GC may need
   multiple recovery cycles because remote TLogs must catch up from old
   generations before remoteRecoveredVersion advances past their recoverAt,
   and purgeOldRecoveredGenerationsCoreState only purges below that.

Summary of all changes from the original test (commit 673a9fce5b):

- Destructor: original had no cleanup on timeout. Timeout left
  clog/connection-failures/disableTLogRecoveryFinish active, poisoning
  the Cycle check.
- rebootPrimaryMaster helper: original rebooted whatever master it found,
  including remote DC masters that can't coordinate recovery when the
  remote DC is clogged.
- for -> while with remote DC guard in accumulation loop: same issue,
  original unconditionally rebooted the master.
- extendConnectionFailures -> enableConnectionFailures: extendConnectionFailures
  doesn't reset connectionFailureEnableTime. After enough iterations, the
  peek cursor assertion window opens while clogged pairs are still active.
- trackRecoveryReq blocking in TLogServer.actor.cpp: original didn't block
  this. Without it, disableTLogRecoveryFinish doesn't actually prevent GC,
  so generations get GC'd during accumulation.
- Master reboot after clearing disableTLogRecoveryFinish: after blocking
  trackRecoveryReq, the current recovery's tracking is stale. Need a fresh
  recovery for GC to proceed.
- GC retry loop replacing single generationReduced wait: original assumed
  GC completes in one recovery cycle. Remote TLogs need to catch up through
  multiple generations, so remoteRecoveredVersion may need multiple recovery
  cycles to advance past all recoverAt versions.

* Reboot remote DC masters in dbAvailable to prevent indefinite blocking

When the master is elected in the clogged remote DC, recovery can never
reach ACCEPTING_COMMITS because the master cannot communicate with primary
DC processes. dbAvailable() would block forever waiting for a state that
can never be reached, consuming the entire 1000s workload budget.

Fix by checking the master DC on each dbInfo update inside dbAvailable.
If recovery has not reached ACCEPTING_COMMITS and the master is in the
remote DC, reboot it immediately to force the CC to elect a primary DC
master. Extract isMasterInRemoteDc helper to share the check.

* Fix GC phase stuck on remote DC master after unclogging

After unclogging the remote DC and entering the GC phase,
rebootPrimaryMaster refused to reboot remote DC masters. But with the
clog removed, a remote DC master can coordinate recovery just fine.
The loop spun every 5s for the entire remaining test budget, always
seeing the same remote DC master, until timeout.

Fix by rebooting whatever master is present in the GC phase (no DC
guard needed since the remote DC is unclogged). Remove the now-unused
rebootPrimaryMaster helper. The primary-DC-only guard remains in the
accumulation loop where the remote DC is still clogged.
2026-04-17 13:55:59 -07:00
Trevor Clinkenbeard e38baf18ea Fix more clang-tidy warnings 2026-04-15 14:23:33 +00:00
Trevor Clinkenbeard 9ba44fd75b Rename *.actor.h files without ACTORs 2026-03-27 04:53:43 +00:00
Trevor Clinkenbeard 25796b7a02 Move ServerDBInfo.actor.h contents directly to ServerDBInfo.h 2026-03-27 04:48:53 +00:00
Trevor Clinkenbeard d477eab73d Merge remote-tracking branch 'apple/main' into dev/tclinkenbeard/management-api-coro 2026-03-25 02:14:46 +00:00
Trevor Clinkenbeard 0fced8a66e Remove role library dependencies on fdbserver/tester 2026-03-24 22:13:52 +00:00
Trevor Clinkenbeard e75340b8fb Move tester code from fdbserver/core to fdbserver/tester 2026-03-24 21:54:07 +00:00
Trevor Clinkenbeard 5cf4b48319 Rename ManagementAPI* files 2026-03-24 16:13:35 +00:00
Trevor Clinkenbeard 96d3f4b1d2 Rename actor files without ACTORs 2026-03-20 08:30:40 +00:00
Trevor Clinkenbeard 9c94fcb649 Merge remote-tracking branch 'apple/main' into dev/tclinkenbeard/modularize-fdbserver2 2026-03-19 17:31:58 +00:00
Michael Stack 673a9fce5b
Fix GcGenerations test to work with commit 774c792e14 generation GC changes (#12798)
Move disableTLogRecoveryFinish=false before generationReduced() wait.

This commit:

  commit 774c792e14
  Author: Jingyu Zhou <jingyu_zhou@apple.com>
  Date:   Mon Jun 30 16:21:45 2025 -0700

      Fix a race that can cause recovery to be stuck (#12212)

      * Fix a race that can causes recovery to be stuck

  changed the generation GC ordering to prevent a race condition where:

  1. In-memory oldLogData was purged first
  2. Recovery could happen before coordinator state was written
  3. TLogs could be displaced, causing recovery to get stuck

The above now updates coordinator state first, then syncs in-memory state,

This test was blocking TLog recovery throughout, then waiting for
generation reduction while TLogs remained blocked. The 774c792e14
fix correctly prevents GC in this state. After the above change, the
test would timeout. Previous to the above, this test was Gc'ing generations
BEFORE the update to coordinator state based off in-memory state. The test
was passing. It started to fail after 774c792e14.

This fix maintains the test's intent:
- Block TLogs during generation creation to create recovery stress
- Unblock TLogs before generation reduction to allow safety criteria evaluation
- Verify that old generations are properly cleaned up

Co-authored-by: stack <stack@duboce.com>
2026-03-19 09:27:16 -07:00
Trevor Clinkenbeard bab8dca1fa Remove unnecessary calls to store coroutine 2026-03-18 08:26:43 -07:00
Trevor Clinkenbeard 9215938fde Merge remote-tracking branch 'origin/main' into dev/tclinkenbeard/modularize-fdbserver2 2026-03-15 23:06:23 -07:00
Trevor Clinkenbeard 6d2acc732b
Merge pull request #12763 from tclinkenbeard-oai/dev/tclinkenbeard/modularize-fdbserver
Create `fdbserver/ratekeeper` library
2026-03-15 18:44:50 -07:00
Trevor Clinkenbeard 6216c9083d Remove wrapper header files from fdbserver/include/fdbserver 2026-03-15 02:22:40 +00:00
Trevor Clinkenbeard d491934128 Clean up for loop variable initialization 2026-03-14 21:57:01 +00:00
Trevor Clinkenbeard faecbdf04e Merge remote-tracking branch 'origin/main' into dev/tclinkenbeard/modularize-fdbserver2 2026-03-12 20:13:26 -07:00
Trevor Clinkenbeard f480f88747 Merge remote-tracking branch 'apple/main' into dev/tclinkenbeard/modularize-fdbserver 2026-03-13 02:21:56 +00:00
Trevor Clinkenbeard 28bb81c6a0 Rename actor.cpp files without ACTORs 2026-03-12 21:30:19 +00:00