mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-12-02 11:59:00 +08:00
Fix data race in ShardCluster.SyncReplicas (#18054)
Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
This commit is contained in:
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
Block a user