From 09d43de9c41c181c8604df5ec3059705e8f66a81 Mon Sep 17 00:00:00 2001 From: sunby Date: Thu, 3 Sep 2026 21:06:48 +0800 Subject: [PATCH] fix: ignore missing segment on L1 commit Signed-off-by: sunby --- .../server/wal/vchannel/segment/lifecycle_writer.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/internal/streamingnode/server/wal/vchannel/segment/lifecycle_writer.go b/internal/streamingnode/server/wal/vchannel/segment/lifecycle_writer.go index 414a2eea4d0..0b9a62f81e8 100644 --- a/internal/streamingnode/server/wal/vchannel/segment/lifecycle_writer.go +++ b/internal/streamingnode/server/wal/vchannel/segment/lifecycle_writer.go @@ -2,9 +2,11 @@ package segment import ( "context" + "errors" "strconv" "github.com/milvus-io/milvus/internal/types" + "github.com/milvus-io/milvus/pkg/v3/mlog" "github.com/milvus-io/milvus/pkg/v3/proto/datapb" "github.com/milvus-io/milvus/pkg/v3/proto/streamingpb" "github.com/milvus-io/milvus/pkg/v3/proto/viewpb" @@ -44,6 +46,17 @@ func (w *segmentLifecycleWriter) CommitL1Segment(ctx context.Context, meta *stre err := retry.Do(ctx, func() error { resp, err := w.coord.SaveBinlogPaths(ctx, req) if err := merr.CheckRPCCall(resp, err); err != nil { + if errors.Is(err, merr.ErrSegmentNotFound) { + // The segment no longer exists in DataCoord (dropped or removed): + // there is nothing to commit, so ignore the error and treat the + // commit as done. DataCoord itself ignores writes to dropped + // segments (returns success), and retrying or failing the segment + // here would only surface a lifecycle event as a task failure. + mlog.Warn(ctx, "segment no longer exists in DataCoord, ignore the L1 commit", + mlog.Int64("segmentID", meta.GetSegmentId()), + mlog.String("vchannel", meta.GetVchannel())) + return nil + } return err } version = dataVersionFromStatus(resp.GetExtraInfo())