From d41f6839e9d931dd3faf2d7c1e9b3dbdfd011069 Mon Sep 17 00:00:00 2001 From: Xianhui Lin <35839735+JsDove@users.noreply.github.com> Date: Wed, 30 Apr 2025 11:24:53 +0800 Subject: [PATCH] fix:add exclusive lock mutex in DropSegmentsOfPartition (#41619) issue:https://github.com/milvus-io/milvus/issues/41615 --------- Signed-off-by: Xianhui.Lin --- internal/datacoord/meta.go | 4 ++-- internal/flushcommon/syncmgr/meta_writer.go | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/internal/datacoord/meta.go b/internal/datacoord/meta.go index 53f6fb4d54..92e367ad72 100644 --- a/internal/datacoord/meta.go +++ b/internal/datacoord/meta.go @@ -2190,8 +2190,8 @@ func (m *meta) getSegmentsMetrics(collectionID int64) []*metricsinfo.Segment { } func (m *meta) DropSegmentsOfPartition(ctx context.Context, partitionIDs []int64) error { - m.segMu.RLock() - defer m.segMu.RUnlock() + m.segMu.Lock() + defer m.segMu.Unlock() // Filter out the segments of the partition to be dropped. metricMutation := &segMetricMutation{ diff --git a/internal/flushcommon/syncmgr/meta_writer.go b/internal/flushcommon/syncmgr/meta_writer.go index 90b84063b6..478cefe8cb 100644 --- a/internal/flushcommon/syncmgr/meta_writer.go +++ b/internal/flushcommon/syncmgr/meta_writer.go @@ -193,6 +193,10 @@ func (b *brokerMetaWriter) NotifyDropPartition(ctx context.Context, collectionID return false, nil }, b.opts...) if err != nil { + if errors.Is(err, merr.ErrServiceUnimplemented) { + log.Info("NotifyDropPartition is not supported, skip") + return nil + } log.Warn("failed to notify drop partition", zap.String("channel", channelName), zap.Int64("collectionID", collectionID),