filer.remote.sync: an unread offset never resolves to the mount's creation time

With the offset read now bounded, a timed-out read fell through to the
directory's creation time and replayed every event already synced. The
error goes back to the startup retry loop, as with -timeAgo; a missing
offset still reads as zero without an error.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Chris LuandClaude Opus 5.5 committed 2026-11-06 01:07:52 -08:00
1 parent c7338fb68f
commit 0a1b6c2944
2 files changed
+10 -1

No files matched your search

@@ -665,6 +665,12 @@ func TestResolveLastSyncOffsetReturnsTheErrorToTheRetryLoop(t *testing.T) {
t.Fatalf("got %v, want the lookup error: without a saved offset the caller's retry loop decides, not an exit", err)
}
// the mount answers but the saved offset is unreadable: never its creation time
mount := &filer_pb.Entry{Name: "x", Attributes: &filer_pb.FuseAttributes{Crtime: 1}}
if _, err := resolveLastSyncOffset("/buckets/x", 0, func() (*filer_pb.Entry, error) { return mount, nil }, readFails); err == nil || !strings.Contains(err.Error(), "filer unavailable") {
t.Fatalf("got %v, want the offset read error: the creation time would replay everything already synced", err)
}
// -timeAgo set, the saved offset unreadable: never now minus timeAgo
if _, err := resolveLastSyncOffset("/buckets/x", time.Hour, func() (*filer_pb.Entry, error) { return nil, nil }, readFails); err == nil || !strings.Contains(err.Error(), "filer unavailable") {
t.Fatalf("got %v, want the offset read error", err)