mirror of https://github.com/milvus-io/milvus.git
fix: [10kcp] Fix concurrent scheule (#38974)
supplement to pr: https://github.com/milvus-io/milvus/pull/38566 Signed-off-by: bigsheeper <yihao.dai@zilliz.com>10kcp
parent
f5f4fed889
commit
584b054981
|
@ -172,6 +172,7 @@ type taskScheduler struct {
|
|||
cluster session.Cluster
|
||||
nodeMgr *session.NodeManager
|
||||
|
||||
scheduleMu sync.Mutex // guards schedule()
|
||||
collKeyLock *lock.KeyLock[int64] // guards Add()
|
||||
tasks *ConcurrentMap[UniqueID, struct{}]
|
||||
segmentTasks *ConcurrentMap[replicaSegmentIndex, Task]
|
||||
|
@ -502,6 +503,8 @@ func (scheduler *taskScheduler) Dispatch(node int64) {
|
|||
log.Info("scheduler stopped")
|
||||
|
||||
default:
|
||||
scheduler.scheduleMu.Lock()
|
||||
defer scheduler.scheduleMu.Unlock()
|
||||
scheduler.schedule(node)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue