From 9d2e5aacbcc98c5d5e48ab285b32191322284718 Mon Sep 17 00:00:00 2001 From: Bingyi Sun Date: Sun, 26 Jun 2022 18:08:16 +0800 Subject: [PATCH] Fix missing dml nodeIDs when recovering from old version (#17800) issue: #17416 Signed-off-by: sunby Co-authored-by: sunby --- internal/querycoord/meta.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/internal/querycoord/meta.go b/internal/querycoord/meta.go index 72abe64193..943c433e47 100644 --- a/internal/querycoord/meta.go +++ b/internal/querycoord/meta.go @@ -253,9 +253,6 @@ func (m *MetaReplica) reloadFromKV() error { nodes[nodeID] = struct{}{} } } - for nodeID := range nodes { - replica.NodeIds = append(replica.NodeIds, nodeID) - } shardReplicas := make([]*milvuspb.ShardReplica, 0, len(dmChannels[collectionInfo.CollectionID])) for _, dmc := range dmChannels[collectionInfo.CollectionID] { @@ -264,6 +261,12 @@ func (m *MetaReplica) reloadFromKV() error { // LeaderAddr: Will set it after the cluster is reloaded DmChannelName: dmc.DmChannel, }) + nodes[dmc.NodeIDLoaded] = struct{}{} + } + replica.ShardReplicas = shardReplicas + + for nodeID := range nodes { + replica.NodeIds = append(replica.NodeIds, nodeID) } err = m.addReplica(replica)