Skip to content

test: prove the write gate stops a stalled node's queued write - #118

Merged
mattmattox merged 2 commits into
mainfrom
claude/gate-sigstop-test
Nov 13, 2026
Merged

mattmattox merged 2 commits into
mainfrom
claude/gate-sigstop-test

Conversation

@mattmattox

Copy link
Copy Markdown
Contributor

Follow-up to #92, which the PM asked for: a test that proves the write gate end to end, in Go and on VMs.

A node is stopped while a writer writes through it. A peer proves it dead, replays its journal and writes the file. Then the stopped node resumes. Without help, its heartbeat goroutine usually notices the lost slot and exits before the queued write reaches the device, so a test like this passed even with the gate off. GOCLUSTERFS_TEST_HEARTBEAT_HOLD, a test-only setting, holds the heartbeat after a pause. The queued write then reaches the gate first, and only the gate can stop it. A node with the setting logs a warning at startup.

Both tests check, in this order:

  • the file holds the peer's data, byte for byte;
  • the node stopped;
  • its gate logged the slot check.

Results on .68:

Test Gate on Gate removed from mount
Go, TestStalledNodesWritesStopAtWriteGate 2/2 pass 2/2 fail: the file reads AAAA…, so the stalled write landed
VM, test_stalled_node_writes_stop_at_write_gate 3/3 pass 3/3 fail: the peer's data is gone and the gate never checked

Also:

  • Test nodes can take extra environment variables (MountedFS.Env, and a third argument to setup_goclusterfs).
  • VM_TEST_ONLY runs only the VM tests whose names contain it.
  • The VM test remounts the stopped node afterwards, and fails if that remount fails.

🤖 Generated with Claude Code

mattmattox and others added 2 commits November 13, 2026 15:41
A node stopped while a writer writes through it resumes after a peer has
replayed it and written the file. GOCLUSTERFS_TEST_HEARTBEAT_HOLD, a
test-only setting, holds its heartbeat after the pause, so the queued
write reaches the device before the heartbeat notices the lost slot. The
Go and VM tests check that the write gate stops the node and the peer's
data stays byte for byte. Without the gate both fail: the stalled write
lands.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mattmattox
mattmattox merged commit b1f8304 into main Nov 13, 2026
17 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