Skip to content

test(goclusterfs): give test nodes a full lock region and release kept holds before closing - #87

Closed
mattmattox wants to merge 1 commit into
mainfrom
claude/snapshot-test-lock-region
Closed

mattmattox wants to merge 1 commit into
mainfrom
claude/snapshot-test-lock-region

Conversation

@mattmattox

Copy link
Copy Markdown
Contributor

Test-only. TestCopyOnWriteKeepsConcurrentInPlaceWrite failed on main about half the time at .68 load. It passed only by taking a live node's lock once the claim was 15s old.

Two causes:

  • Since fix(lock): claim locks through per-node slots and cache released holds #29 a lock row is 256 KB, so the snapshot tests' 512 KB lock region had 2 rows. Unrelated locks of different test nodes shared them, and the hook-paused node blocked the other.
  • Cleanup closed a test node's device before the hold it kept for 10 ms was released. The release failed and the claim stayed. TestSnapshotKeepsDataThroughWrites hit this sometimes.

On .68: 2 of the 19 tests that use these helpers waited 15s on main. With the fix, the copy-on-write test is fast and all 86 goclusterfs tests pass. The other 15s and 30s tests in the package simulate crashed or stuck holders on purpose.

🤖 Generated with Claude Code

…t holds before closing

Since #29 a lock row is 256 KB, so the snapshot tests' 512 KB lock region
had 2 rows and unrelated locks of different test nodes shared them. And
test cleanup closed a node's device before its kept holds expired, so the
release failed and the claim stayed. Either way the next node waited 15s
for the claim to go stale, then took a live node's lock.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mattmattox added a commit that referenced this pull request Nov 13, 2026
A hold still cached when the device closes stays claimed until it goes
stale, so the next node waited 15s. Taken from #87.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mattmattox added a commit that referenced this pull request Nov 13, 2026
…k region (#88)

* test(goclusterfs): give the snapshot and lock test helpers a full lock region

Since #29 a lock record is a 256 KB row, so the snapshot helper's 512 KB
region held 2 records and the lock-commit helper's 1 MB held 4. Locks of
different types shared records, a claim went stale after 15s, and
TestCopyOnWriteKeepsConcurrentInPlaceWrite could read old data.

Both helpers now use superblock.LockRegionSize. The test that needs an
inode and a block lock in one record keeps a 4-record region.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(goclusterfs): release cached lock holds before a test device closes

A hold still cached when the device closes stays claimed until it goes
stale, so the next node waited 15s. Taken from #87.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
@mattmattox mattmattox closed this Nov 13, 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