Skip to content

fix(goclusterfs): make the kernel fetch a file's size again on open - #109

Merged
mattmattox merged 1 commit into
mainfrom
claude/open-refreshes-size
Nov 13, 2026
Merged

mattmattox merged 1 commit into
mainfrom
claude/open-refreshes-size

Conversation

@mattmattox

Copy link
Copy Markdown
Contributor

TestMultiNodeExtentCacheCoherency/TruncateRewrite read 256 KB of a 300 KB file in the full suite on .68. The data on disk was correct. The reader's own Open and Read logged Size=307200, but its kernel had cached i_size=262144. That size came from a Lookup that something on the desktop ran mid-rewrite (it also probed .xdg-volume-info and autorun.inf). The kernel kept it for -attr-timeout and stopped the read there. Open now expires the kernel's cached attributes (FUSE_NOTIFY_INVAL_INODE with offset -1, so no pages are dropped and no inode lock is taken).

Tests on .68 (load 33–45; .66 was off limits):

  • TruncateRewrite alone at 30500b7: passed 20/20. It needs a mid-write lookup to fail.
  • New TestMultiNodeOpenRefreshesCachedSize: failed 3/3 without the fix with the same 262144-vs-307200 read. With the fix it passed 5/5, then 3/3 again after rebasing onto 8d02d3b.
  • -short integration suite: 121/0.
  • goclusterfs unit tests in -short, lint and parity: clean.
  • TestFsckRepairsOlderSharing and TestSFBPersistence: passed 3/3 each. Their fusermount EBUSY errors are likely gvfs/udisks on .68 probing the mounts.

TruncateRewrite already runs in CI's -short group, so this PR doesn't change that.

🤖 Generated with Claude Code

A read right after open stopped at whatever size this node's kernel had
cached for -attr-timeout. When anything on the node looked the file up
while another node was writing it, that was a partial size: in the full
integration suite on .68, a desktop volume monitor scanned the mount mid
rewrite and TestMultiNodeExtentCacheCoherency/TruncateRewrite read 256 KB
of a 300 KB file. Open now expires the kernel's cached attributes, so
fstat and reads ask for the size, which comes from disk.

TestMultiNodeOpenRefreshesCachedSize stats the file on the reader halfway
through the write; it fails every run without the fix.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mattmattox
mattmattox merged commit 47cf5f6 into main Nov 13, 2026
13 checks passed
mattmattox added a commit that referenced this pull request Nov 13, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mattmattox added a commit that referenced this pull request Nov 13, 2026
* feat: clean API shutdown, /health states, and shared CLI exit codes

API shutdown: the server counts every request, closes its listener on Stop,
gives requests in flight ShutdownTimeout to finish, then cancels their
contexts and closes their connections, and returns only after every handler
and the serve goroutine have ended. Mount stops the API before the unmount on
SIGINT/SIGTERM and closes the filesystem only after the unmount, in one
place; a busy unmount no longer leaves a closed filesystem mounted.

/health: device (last I/O failed: unhealthy), journal (corrupt: unhealthy,
recovering: degraded), recovery (replaying a crashed peer: degraded) and
broadcast (send failing or no multicast and no peers: degraded). Degraded
answers 200, unhealthy 503. gfsctl health decodes the 503 body.

CLIs: goclusterfs-mount, goclusterfs-fsck and gfsctl share exit codes
(0 ok, 8 failure, 16 usage; fsck adds 1 and 4, gfsctl health 1 and 4),
error messages say what to do next, and -debug prints [DEBUG] lines in all
three. Mount's [DEBUG] lines are now off by default; go-fuse tracing moved
to -fuse-debug. fsck no longer exits 2 on a bad flag.

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

* fix(cli): keep the "Failed to open device" prefix that tests and logs match

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

* test(logging): fail on [DEBUG] lines that bypass -debug

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

* fix(goclusterfs): route #109's debug line through logging.Debugf

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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