mount: stop a flush merge once a filer accepts the write

withFilerClient can call the callback on several filers. A refusal from
one left its stored entry behind, so a later filer's success went on to
another merge round.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Chris LuandClaude Opus 5.5 committed 2026-11-12 17:11:59 -08:00
1 parent 5fcd9d81e9
commit c3c4085a81
1 file changed
+2 -1
+2 -1
View File
@@ -338,6 +338,7 @@ func (wfs *WFS) createContentEntry(ctx context.Context, fh *FileHandle, request
var stored *filer_pb.Entry
err = wfs.withFilerClient(ctx, false, wfs.filerRPCWait(), func(ctx context.Context, client filer_pb.SeaweedFilerClient) error {
var callErr error
stored = nil
resp, callErr = filer_pb.CreateEntryWithResponse(ctx, client, request)
if base == nil || attempt >= maxContentFlushMerges || !errors.Is(callErr, filer_pb.ErrPreconditionFailed) {
return callErr
@@ -351,7 +352,7 @@ func (wfs *WFS) createContentEntry(ctx context.Context, fh *FileHandle, request
merged = proto.Clone(request.Entry).(*filer_pb.Entry)
wfs.mapPbIdFromFilerToLocal(merged)
}
if stored == nil {
if err == nil || stored == nil {
return resp, merged, err
}
next, ok := mergeContentEntry(stored, base, local, sent)