fix:add exclusive lock mutex in DropSegmentsOfPartition (#41619)

issue:https://github.com/milvus-io/milvus/issues/41615

---------

Signed-off-by: Xianhui.Lin <xianhui.lin@zilliz.com>
This commit is contained in:
Xianhui Lin 2025-04-30 11:24:53 +08:00 committed by GitHub
parent 1510dea7e3
commit d41f6839e9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 2 deletions

View File

@ -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{

View File

@ -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),