Skip to content

Fix Windows CI after #2: metrics test, single-writer commit path - #4

Merged
ChromaBeast merged 2 commits into
mainfrom
fix/windows-ci-commit-handoff-v2
Nov 12, 2026
Merged

ChromaBeast merged 2 commits into
mainfrom
fix/windows-ci-commit-handoff-v2

Conversation

@ChromaBeast

Copy link
Copy Markdown
Owner

What changed

Follow-up to #2, whose Windows CI job failed after merge. Two commits:

  1. test(metrics): require the disk-free gauge only where it is reported. metrics.DiskFreeBytes is unix-only (the gauge is omitted elsewhere, as documented), but TestMetricsAuthAndFormat required beastdb_disk_free_bytes unconditionally, so it failed on Windows CI with missing "beastdb_disk_free_bytes ". The test now checks the gauge only when DiskFreeBytes reports support. This one is a certain fix.
  2. perf(engine): let the first writer lead its own commit group. Instead of waking a dedicated committer goroutine for every write, the writer that finds no commit in progress runs the queued group on its own goroutine; if more writers queued meanwhile, a drain goroutine serves them. Group-commit semantics are unchanged (one fsync per group, engine lock held across it, observer notified in LSN order, one group at a time so queue order is LSN order). Close now waits for the in-flight group and rejects later writes.

Why

TestEngineSystemWorkloadBenchmark also failed on Windows CI in #2: 398 ops/s against its fixed 1000 ops/s floor, with p95 latency 16.5 ms. Earlier Windows runs on main measured 1,351 and 1,923 ops/s with p95 about 3.5 ms. My hypothesis is that waking a separate goroutine for every uncontended write costs up to a timer tick (about 15.6 ms) on Windows, which matches the p95.

Things a reviewer should know

  • The commit-path change is unproven. I cannot run Windows locally, and on macOS it did not change the local numbers. This PR's Windows CI run is the experiment. If Windows throughput does not recover, drop the second commit; it is separate for that reason. The throughput floor in the test is not changed.
  • What I could and could not establish locally: on the original code (d8c1280) the benchmark gets about 1,560 to 1,710 ops/s in a full parallel go test ./... -race run; on the merged branch about 830 to 930 (fix branch included). Run alone, the two are within about 4 to 7% of each other. I counted fsyncs (one per write, same as before) and ruled out the beastbench tests and synthetic fsync load as the cause. The remaining difference under a full parallel run is unexplained.
  • Tests pass with the race detector, including the group-commit crash-recovery, conditional-atomicity and write-after-close tests. The benchmark test still fails in a full parallel run on this laptop, as described above.
  • Supersedes Fix Windows CI after #2: metrics test, single-writer commit path #3, which was based on commit hashes from before main was rewritten and conflicted. This branch is the same two commits rebased onto the current main.

🤖 Generated with Claude Code

ChromaBeast and others added 2 commits November 12, 2026 17:22
…s it

DiskFreeBytes is unix-only, so TestMetricsAuthAndFormat failed on Windows CI
with a missing beastdb_disk_free_bytes line. Require the gauge only when
DiskFreeBytes reports support.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Instead of waking a dedicated committer goroutine for every write, the writer
that finds no commit in progress runs the queued group on its own goroutine;
if more writers queued meanwhile, a drain goroutine serves them. Group commit
semantics are unchanged (one fsync per group, lock held across it, observer
in LSN order). Aims to remove a cross-goroutine wake-up per uncontended
write, which can cost up to a timer tick on Windows. Not yet verified on
Windows.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-12T12:09:37.817635Z f851bd6 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@ChromaBeast
ChromaBeast merged commit 0389f49 into main Nov 12, 2026
3 of 4 checks passed
ChromaBeast added a commit that referenced this pull request Nov 13, 2026
Fix Windows CI after #2: metrics test, single-writer commit path
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