Skip to content

cluster-mode: serialize topology print; flag staircase fan-out - #491

Merged
fcostaoliveira merged 1 commit into
masterfrom
fix/cluster-topology-print-race
Jun 25, 2026
Merged

fcostaoliveira merged 1 commit into
masterfrom
fix/cluster-topology-print-race

Conversation

@fcostaoliveira

@fcostaoliveira fcostaoliveira commented Jun 25, 2026 •

Copy link
Copy Markdown
Collaborator

Follow-up to #489 addressing two Cursor Bugbot findings (also fixed on the 2.4 backport #490):

  1. Stale topology log ordering — print_topology_summary() released the print-gate mutex before writing the topology block, so two workers could interleave their blocks or emit a superseded topology after a newer one. The lock is now held across the entire emit.
  2. Staircase inflates connection count — with --clients-start, cfg.clients is the peak (full-ramp) value, so Total connections / aggregate rate overstated the fan-out if the ramp didn't complete. Both the startup block and the results summary now label these "at full ramp" when staircase is in use.

No functional change to the numbers outside staircase mode.

🤖 Generated with Claude Code


Note

Low Risk
Logging synchronization and output labeling only; no change to connection math or routing behavior outside clarified reporting.

Overview
Topology logging — print_topology_summary() no longer releases the process-global print gate mutex after updating (run id, signature); the lock stays held through the entire stderr emit (endpoint list, total connections, rate limit) and unlocks at the end. That stops worker threads from interleaving blocks or printing an older topology after a newer one.

Staircase ramp clarity — When --clients-start is set, clients is the peak connection count, not necessarily what is open mid-ramp. Startup topology output (cluster_client.cpp) and the run results summary (memtier_benchmark.cpp) append " at full ramp" to total-connection and aggregate rate-limit lines so those figures read as targets, not live counts. Numbers are unchanged when staircase mode is off.

Reviewed by Cursor Bugbot for commit 1b57a3c. Bugbot is set up for automated code reviews on this repo. Configure here.

Follow-up to #489 addressing two Cursor Bugbot findings (also raised on
the 2.4 backport #490):

- Hold the print-gate mutex across the whole topology emit so two workers
  can't interleave blocks or print a superseded topology after a newer one
  (previously the lock was released before the fprintf block).
- With the --clients-start staircase ramp, label Total connections /
  rate-limit target as 'at full ramp' (cfg.clients is the peak value), so
  the figure isn't read as the count already opened.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@jit-ci

jit-ci Bot commented Jun 25, 2026

Copy link
Copy Markdown

🛡️ Jit Security Scan Results

CRITICAL HIGH MEDIUM

✅ No security findings were detected in this PR


Security scan by Jit

@fcostaoliveira
fcostaoliveira merged commit 8eadfbe into master Jun 25, 2026
153 of 155 checks passed
fcostaoliveira added a commit that referenced this pull request Jun 25, 2026
…ort) (#490)

Backport of #489 (+ #491 fixes) to 2.4, re-implemented against 2.4's primary-only cluster model (m_slot_to_shard[16384]). Reports discovered endpoint count, total connection fan-out, and aggregate rate-limit target at benchmark start and in the results summary (text + JSON). Also enables the full CI matrix for the 2.4 branch.
@fcostaoliveira fcostaoliveira mentioned this pull request Jul 1, 2026
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