mirror of https://github.com/milvus-io/milvus.git
Fix data race in ShardCluster.SyncReplicas (#18054)
Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>pull/17971/head
parent
d652fa567a
commit
63230f0280
|
@ -301,6 +301,8 @@ func (sc *ShardCluster) SyncSegments(distribution []*querypb.ReplicaSegmentsInfo
|
|||
})
|
||||
}
|
||||
}
|
||||
|
||||
allocations := sc.segments.Clone(filterNothing)
|
||||
sc.mut.Unlock()
|
||||
|
||||
// notify handoff wait online if any
|
||||
|
@ -310,7 +312,7 @@ func (sc *ShardCluster) SyncSegments(distribution []*querypb.ReplicaSegmentsInfo
|
|||
|
||||
sc.mutVersion.Lock()
|
||||
defer sc.mutVersion.Unlock()
|
||||
version := NewShardClusterVersion(sc.nextVersionID.Inc(), sc.segments.Clone(filterNothing))
|
||||
version := NewShardClusterVersion(sc.nextVersionID.Inc(), allocations)
|
||||
sc.versions.Store(version.versionID, version)
|
||||
sc.currentVersion = version
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue