Skip to content

test(goclusterfs): give the snapshot and lock test helpers a full lock region - #88

Merged
mattmattox merged 2 commits into
mainfrom
claude/full-lock-region-tests
Nov 13, 2026
Merged

mattmattox merged 2 commits into
mainfrom
claude/full-lock-region-tests

Conversation

@mattmattox

@mattmattox mattmattox commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Since #29 a lock record is a 256 KB row. openSnapshotFS had 512 KB of locks (2 records) and the lock-commit helper had 1 MB (4 records), so locks of different types shared records and a claim went stale after 15s. Both helpers now use superblock.LockRegionSize, and they release cached holds when a test ends (from #87). TestWriteWhenInodeAndBlockShareLockRecord keeps a 4-record region on purpose, because it needs a collision.

On .68 (main cddbaf5 vs this branch):

  • TestCopyOnWriteKeepsConcurrentInPlaceWrite: main failed 1/5 ("inode 3: data mismatch at offset 0") and took 15s per run; the branch passed 5/5 in 0.1s.
  • TestSnapshotKeepsDataThroughWrites: 15.2s → 0.2s.
  • goclusterfs package with -short: 99s → 68s. That includes test(goclusterfs): give test nodes a full lock region and release kept holds before closing #87's cleanups, which release cached holds before a test device closes so they don't go stale.
  • The four helper tests passed 10/10 each, all under 2s.

The dir, inode and bitmap tests also use 4-record regions, but they don't wait (1–2s per package), so they're unchanged. Works with #85: regions under 256 rows fall back to the shared hash.

Not fixed here: three crash tests still wait 15s, because remountAndReplay doesn't adopt the crashed node's claims the way cmd/mount does (AdoptOwner).

🤖 Generated with Claude Code

mattmattox and others added 2 commits November 13, 2026 11:46
…k 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>
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
mattmattox merged commit 8f4a3de into main Nov 13, 2026
13 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