Skip to content

Commit

Permalink
enhance: Use channel name map finding channel watcher (milvus-io#34294)
Browse files Browse the repository at this point in the history
See also milvus-io#33235

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
  • Loading branch information
congqixia committed Jul 1, 2024
1 parent 734415b commit e083d99
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions internal/datacoord/channel_manager_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -384,20 +384,19 @@ func (m *ChannelManagerImplV2) FindWatcher(channel string) (UniqueID, error) {

infos := m.store.GetNodesChannels()
for _, info := range infos {
for _, channelInfo := range info.Channels {
if channelInfo.GetName() == channel {
return info.NodeID, nil
}
_, ok := info.Channels[channel]
if ok {
return info.NodeID, nil
}
}

// channel in buffer
bufferInfo := m.store.GetBufferChannelInfo()
for _, channelInfo := range bufferInfo.Channels {
if channelInfo.GetName() == channel {
return bufferID, errChannelInBuffer
}
_, ok := bufferInfo.Channels[channel]
if ok {
return bufferID, errChannelInBuffer
}

return 0, errChannelNotWatched
}

Expand Down

0 comments on commit e083d99

Please sign in to comment.