From d421effb03e20ca029e5eedc053618135fd254f0 Mon Sep 17 00:00:00 2001 From: wei liu Date: Wed, 18 Sep 2024 22:21:12 +0800 Subject: [PATCH] fix: fix search/query/count may access same growing and sealed segment (#36258) (#36288) issue: #36257 pr: #36258 during syncTargetVersion, sealed segment should be excluded, to avoid it's growing segment be conusmed from stream again. Signed-off-by: Wei Liu --- internal/querynodev2/services.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/internal/querynodev2/services.go b/internal/querynodev2/services.go index a8e6b3d03d..85d3a19369 100644 --- a/internal/querynodev2/services.go +++ b/internal/querynodev2/services.go @@ -1339,6 +1339,13 @@ func (node *QueryNode) SyncDistribution(ctx context.Context, req *querypb.SyncDi return id, action.GetCheckpoint().Timestamp }) shardDelegator.AddExcludedSegments(droppedInfos) + flushedInfo := lo.SliceToMap(action.GetSealedInTarget(), func(id int64) (int64, uint64) { + if action.GetCheckpoint() == nil { + return id, typeutil.MaxTimestamp + } + return id, action.GetCheckpoint().Timestamp + }) + shardDelegator.AddExcludedSegments(flushedInfo) shardDelegator.SyncTargetVersion(action.GetTargetVersion(), action.GetGrowingInTarget(), action.GetSealedInTarget(), action.GetDroppedInTarget(), action.GetCheckpoint()) case querypb.SyncType_UpdatePartitionStats: