Skip to content

fix(cluster): exact CANCEL_WAIT with reliable cleanup retry#54

Merged
sqlrush merged 2 commits into
mainfrom
fix/ges-timeout-cleanup
Jul 15, 2026
Merged

fix(cluster): exact CANCEL_WAIT with reliable cleanup retry#54
sqlrush merged 2 commits into
mainfrom
fix/ges-timeout-cleanup

Conversation

@sqlrush

@sqlrush sqlrush commented Jul 14, 2026

Copy link
Copy Markdown
Owner

What changed

  • Send a wait-sequence-exact CANCEL_WAIT when a GES request times out, using the sequence captured by the original request.
  • Preserve abandoned wait entries long enough to release any late orphan grant.
  • Route RELEASE, LMD cancel, and native-probe cleanup frames through a bounded FIFO retry queue that never overwrites its oldest entry.
  • Export one-shot 50% and 90% queue-pressure warnings and counters, including the corresponding GRD dump-key baseline updates.

Why

The timeout path previously tombstoned the local request without removing the exact remote waiter, and a fire-and-forget release could be dropped when the outbound ring was full. Under contention this leaked remote waiter/holder state and amplified subsequent lock timeouts.

Retry exhaustion intentionally remains fail-stop. Abort cleanup cannot block, ERROR would unwind the cleanup caller, and silently dropping a correctness frame recreates the leak. The 1024-frame budget covers one two-frame abort wave for 512 backends and sixteen 64-frame LMON drain batches; 50%/90% lifetime warnings expose pressure before the PANIC boundary.

Validation

  • make -C src/test/cluster_unit check: 178 binaries passed.
  • make -C src/test/cluster_regress check: 13/13 passed.
  • fast-gate smoke TAP subset: 8 files, 211 tests passed.
  • t/017 + t/104: 27 tests passed; authoritative GRD key count is 53 and both new counters are asserted.
  • clang-format-18 dry-run and git diff --check passed.

Unit tests prove exact cancellation and lossless FIFO retry behavior. End-to-end remote waiter/holder/WFG cleanup remains an explicit S3 acceptance item: lock timeouts and residual GRD state must return to zero.

SqlRush added 2 commits July 15, 2026 05:12
On REQUEST timeout, send a wait_seq-exact CANCEL_WAIT using the sequence sampled in the original request, retain abandoned wait entries for orphan-GRANT release, and never silently overwrite RELEASE/CANCEL/native-probe cleanup frames.

The fixed retry budget remains fail-stop: exhaustion PANICs because abort cleanup cannot wait, ERROR would unwind the cleanup caller, and dropping a frame recreates remote waiter/holder leakage. Capacity 1024 is a burst budget, not an unreachable proof: timeout cleanup can emit two frames per backend per abort wave, 1024 equals one such wave for 512 backends and sixteen 64-frame LMON drain batches, while backend-exit releases plus LMD/native traffic share the pool. Emit lifetime LOG-once warnings and exported counters at 50 and 90 percent before the PANIC cliff.

Evidence boundary: unit coverage proves the timeout uses the original wait_seq and the retry FIFO preserves/retries exact frames without overwriting the oldest. It does not prove the remote master removed the waiter, holder, and WFG edge. End-to-end closure is explicitly assigned to the complete S3 rerun: lock-timeout must be zero and the GRD waiter/holder/WFG baselines must return to zero.

Tests: make -C src/test/cluster_unit check (178 binaries passed); clang-format-18 dry-run; git diff --check.
@sqlrush sqlrush marked this pull request as ready for review July 15, 2026 03:10
@sqlrush sqlrush merged commit e1b2a06 into main Jul 15, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant