* filer: take the log fence without registering an in-flight stamp
LogFenceTsNs stamped and released at once, so each fence briefly sat in
the in-flight registry, where a concurrent claim could be capped below it,
and took the registry mutex twice. Draw the fence from the same sequence
under one lock acquisition without registering it. Lookups are about to
take one per read.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* filer: fence CreateEntry and UpdateEntry from the event stamp sequence
Both stamped their pre-write fence from the raw wall clock, so after a
backwards clock step the fence could sit below events the acknowledged
state already reflects, including the previous write's event on the same
key. A mount that versions a no-op ack by that fence would then accept an
older event over it. Take the fence from the same sequence the events use,
so it lands above every earlier event and below the write's own.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* filer: fence a remote-object cache commit from the event stamp sequence
CacheRemoteObjectToLocalCluster stamped its commit fence from the raw wall
clock under the path lock. After a backwards clock step that fence fell
below events the cached entry already reflects, the same as the old
CreateEntry and UpdateEntry fences. Take it from the event stamp sequence.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* filer: fence lookups from the event stamp sequence
fencedFindEntry, behind LookupDirectoryEntry and LookupDirectoryEntries,
stamped its read fence from the raw wall clock under the shared path lock.
After a backwards clock step the fence fell below events the returned
entry already reflects, so a client versioning the entry by it could take
an older event as newer. Draw it from the event stamp sequence instead.
The fence registers nothing in flight, so it never caps flush or delivery
claims; it costs one short critical section on the stamp registry's mutex
per lookup.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* filer: keep the stamp sequence above renumbered log positions
The meta log buffer renumbers an event appended out of stamp order past
the last position it holds, and that position is what subscribers see.
Concurrent writers append in whatever order their notify work finishes,
and with the wall clock behind the sequence every renumbered position
lands past the last stamp, so a later fence could sit below an event the
fenced state already reflects. Feed each delivered position back into the
sequence stamps and fences draw from.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* filer: draw a lookup's fence after the read
FindEntry can log an event of its own on the path it reads: importing a
remote object under a mount creates the entry, and an expired entry is
deleted. Both stamp above a fence drawn before the read, while the
returned state reflects them. Draw the fence after the read with the
shared path lock still held; a locked writer on the path cannot land in
between.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* filer: draw the remote cache commit's fence after its re-read
The re-read can import the object from the remote and log that event; an
entry changed during the download is returned with this fence, which has to
cover the import.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* filer: take the exclusive path lock for a lookup that writes
Fenced lookups share the path lock, and FindEntry can write under it: it
deletes an expired S3 object and imports an object from a remote mount,
logging an event either way. A lookup that read the old state just before
could then draw its fence above that event and return the old state, so a
client skipped the event as already reflected.
A fenced lookup now reads with FindEntry reporting such a write instead
of making it, and redoes the read under the exclusive path lock when it
does. The shared lock is released first, so nothing holding it waits on
the exclusive one.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* filer: escalate a fenced lookup only when the remote has the object
Refusing the lazy fetch before the remote stat sent every fenced lookup that
missed under a remote mount to the exclusive lock, so concurrent lookups of
one missing key ran their stats one after another instead of sharing one.
A lookup that may not write now stats in a flight of its own and asks for
the exclusive lock only when there is an object to import.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* filer: require the live object from the first lookup in the expiry race test
The fence check was skipped when the first lookup errored or found
nothing, so a run that took either path passed without checking
anything. The store hands that lookup its copy before the hook expires
the object, so it always returns the live object; require that, then
compare its fence against the delete.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* filer: release the shared remote stat only after every lookup joined it
The test let the stat sleep and assumed all eight lookups joined within
that window, so a lookup scheduled late could start a second, correct flight
and fail the count. The stat now waits on a gate the test opens once the
other seven lookups wait on the in-flight call.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>