mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-12-01 11:29:48 +08:00
Remove the unnecessary lock in the shard_cluster (#20414)
Signed-off-by: SimFG <bang.fu@zilliz.com> Signed-off-by: SimFG <bang.fu@zilliz.com>
This commit is contained in:
parent
53850e340c
commit
c08657e079
@ -280,9 +280,7 @@ func (sc *ShardCluster) updateSegment(evt shardSegmentInfo) {
|
|||||||
log.Info("ShardCluster update segment", zap.Int64("nodeID", evt.nodeID), zap.Int64("segmentID", evt.segmentID), zap.Int32("state", int32(evt.state)))
|
log.Info("ShardCluster update segment", zap.Int64("nodeID", evt.nodeID), zap.Int64("segmentID", evt.segmentID), zap.Int32("state", int32(evt.state)))
|
||||||
// notify handoff wait online if any
|
// notify handoff wait online if any
|
||||||
defer func() {
|
defer func() {
|
||||||
sc.segmentCond.L.Lock()
|
|
||||||
sc.segmentCond.Broadcast()
|
sc.segmentCond.Broadcast()
|
||||||
sc.segmentCond.L.Unlock()
|
|
||||||
}()
|
}()
|
||||||
|
|
||||||
sc.mut.Lock()
|
sc.mut.Lock()
|
||||||
@ -358,9 +356,7 @@ func (sc *ShardCluster) SyncSegments(distribution []*querypb.ReplicaSegmentsInfo
|
|||||||
sc.mut.Unlock()
|
sc.mut.Unlock()
|
||||||
|
|
||||||
// notify handoff wait online if any
|
// notify handoff wait online if any
|
||||||
sc.segmentCond.L.Lock()
|
|
||||||
sc.segmentCond.Broadcast()
|
sc.segmentCond.Broadcast()
|
||||||
sc.segmentCond.L.Unlock()
|
|
||||||
|
|
||||||
sc.mutVersion.Lock()
|
sc.mutVersion.Lock()
|
||||||
defer sc.mutVersion.Unlock()
|
defer sc.mutVersion.Unlock()
|
||||||
@ -663,9 +659,7 @@ func (sc *ShardCluster) LoadSegments(ctx context.Context, req *querypb.LoadSegme
|
|||||||
}
|
}
|
||||||
|
|
||||||
// notify handoff wait online if any
|
// notify handoff wait online if any
|
||||||
sc.segmentCond.L.Lock()
|
|
||||||
sc.segmentCond.Broadcast()
|
sc.segmentCond.Broadcast()
|
||||||
sc.segmentCond.L.Unlock()
|
|
||||||
|
|
||||||
sc.mutVersion.Lock()
|
sc.mutVersion.Lock()
|
||||||
defer sc.mutVersion.Unlock()
|
defer sc.mutVersion.Unlock()
|
||||||
|
Loading…
Reference in New Issue
Block a user