From 8bf659dcb679532cf7ba588af4fb55894967cb72 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Tue, 1 Dec 2026 15:16:51 -0800 Subject: [PATCH] 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 --- weed/server/filer_grpc_server_lookup_fence_test.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/weed/server/filer_grpc_server_lookup_fence_test.go b/weed/server/filer_grpc_server_lookup_fence_test.go index f873dd9eaf..c2cdb61f0c 100644 --- a/weed/server/filer_grpc_server_lookup_fence_test.go +++ b/weed/server/filer_grpc_server_lookup_fence_test.go @@ -74,8 +74,13 @@ func TestLookupFenceNotAboveAConcurrentExpiryDelete(t *testing.T) { if _, found := store.entries[path]; found { t.Fatal("expired object still stored") } + // The store hands the first lookup its copy before the hook expires the + // object, so it returns the live object. + if a.err != nil || a.resp.GetEntry() == nil { + t.Fatalf("first lookup: err=%v entry=%v, want the live object", a.err, a.resp.GetEntry()) + } deletePos := fs.filer.LocalMetaLogBuffer.LastTsNs.Load() - if a.err == nil && a.resp.Entry != nil && a.resp.LogTsNs >= deletePos { + if a.resp.LogTsNs >= deletePos { t.Fatalf("first lookup returned the object under fence %d, at or above its delete at %d", a.resp.LogTsNs, deletePos) } }