mount: keep the posix-lock hint until the release RPC succeeds (#9670)

routedReleasePosixOwner dropped the local owner hint before sending
RELEASE_POSIX_OWNER, so a transient RPC failure left the lock held on the
owner filer with no local record to retry from — stranded until session-lease
reaping. Drop the hint only after a successful release; on failure keep it so
a later flush retries, with lease reaping as the backstop.
This commit is contained in:
Chris Lu
2026-05-25 00:00:34 -07:00
committed by GitHub
parent 3481f13f54
commit 3976264391
+5 -1
View File
@@ -287,7 +287,6 @@ func (wfs *WFS) routedReleasePosixOwner(inode, owner uint64) {
if !wfs.posixHint.has(inode, owner) {
return
}
wfs.posixHint.drop(inode, owner)
key, ok := wfs.posixLockKeyForInode(inode)
if !ok {
return
@@ -295,8 +294,13 @@ func (wfs *WFS) routedReleasePosixOwner(inode, owner uint64) {
ctx, cancel := context.WithTimeout(context.Background(), posixLockReleaseTimeout)
defer cancel()
if _, err := wfs.callPosixLock(ctx, key, filer_pb.PosixLockOp_RELEASE_POSIX_OWNER, posixlock.Range{Sid: wfs.posixSid, Owner: owner}); err != nil {
// Keep the hint so a later flush retries the release; dropping it on a
// transient failure would strand the lock until the owner filer's
// session-lease reaping expires it.
glog.Warningf("routed release posix owner %s: %v", key, err)
return
}
wfs.posixHint.drop(inode, owner)
}
func (wfs *WFS) routedReleaseFlockOwner(inode, owner uint64) {