filer.remote.sync: keep the resume position for the retry when its write fails

The retry in the same process now resumes from the position the ended
subscription returned, as filer.backup does, so a failed offset write
followed by an empty read cannot recompute -timeAgo past a failed event.

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:43:44 -08:00
1 parent a0d60ee00f
commit 39ef551bcf
5 files changed
+31 -8

No files matched your search

@@ -725,6 +725,19 @@ func TestSaveResumeOffsetKeepsTheStartForTheRetry(t *testing.T) {
if got.After(start) {
t.Fatalf("the retry starts at %v, after the first subscription's start %v", got, start)
}
// the write fails and the retry reads no saved offset: the position
// returned for this process still holds the start
failingAddress, failingDialOption := startFiler(t, &failingKvFilerServer{})
resumeTsNs := saveResumeOffset(failingDialOption, failingAddress, dir, processor)
emptyAddress, emptyDialOption := startKvFiler(t)
got, err = collectLastSyncOffset(&stubFilerClient{}, emptyDialOption, emptyAddress, dir, time.Hour, resumeTsNs)
if err != nil {
t.Fatal(err)
}
if got.After(start) {
t.Fatalf("after a failed write the retry starts at %v, after the first subscription's start %v", got, start)
}
}
func TestRemoteUploadReaderSharesOneChunkCache(t *testing.T) {