fix: Data race in datacoord channel manager (#37866)

issue: #37865

Signed-off-by: Wei Liu <wei.liu@zilliz.com>
pull/37911/head
wei liu 2024-11-21 19:00:32 +08:00 committed by GitHub
parent d7dcc752f1
commit 97a44b62fd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -449,6 +449,7 @@ func (m *ChannelManagerImpl) AdvanceChannelState(ctx context.Context) {
standbys := m.store.GetNodeChannelsBy(WithAllNodes(), WithChannelStates(Standby))
toNotifies := m.store.GetNodeChannelsBy(WithoutBufferNode(), WithChannelStates(ToWatch, ToRelease))
toChecks := m.store.GetNodeChannelsBy(WithoutBufferNode(), WithChannelStates(Watching, Releasing))
maxNum := len(m.store.GetNodes()) * paramtable.Get().DataCoordCfg.MaxConcurrentChannelTaskNumPerDN.GetAsInt()
m.mu.RUnlock()
// Processing standby channels
@ -458,7 +459,6 @@ func (m *ChannelManagerImpl) AdvanceChannelState(ctx context.Context) {
var (
updatedToNotifies bool
maxNum = len(m.store.GetNodes()) * paramtable.Get().DataCoordCfg.MaxConcurrentChannelTaskNumPerDN.GetAsInt()
executingNum = len(toChecks)
toNotifyNum = maxNum - executingNum
)