mirror of
https://gitee.com/milvus-io/milvus.git
synced 2025-12-06 17:18:35 +08:00
fix: compatibility with old sessions upgrade from 2.5 to 2.6 in standalone mode (#42645)
compatibility with old sessions upgrade from 2.5 to 2.6 in standalone mode issue:https://github.com/milvus-io/milvus/issues/42602 Signed-off-by: Xianhui.Lin <xianhui.lin@zilliz.com>
This commit is contained in:
parent
43f0c56ce7
commit
d5c41acec1
@ -116,13 +116,35 @@ func (c *Client) getMixCoordAddr() (string, error) {
|
||||
}
|
||||
ms, ok := msess[key]
|
||||
if !ok {
|
||||
log.Warn("MixCoordClient mess key not exist", zap.Any("key", key))
|
||||
return "", errors.New("find no available mixcoord, check mixcoord state")
|
||||
if paramtable.GetRole() == typeutil.StandaloneRole {
|
||||
return c.getCompatibleMixCoordAddr()
|
||||
} else {
|
||||
log.Warn("MixCoordClient mess key not exist", zap.Any("key", key))
|
||||
return "", errors.New("find no available mixcoord, check mixcoord state")
|
||||
}
|
||||
}
|
||||
log.Debug("MixCoordClient GetSessions success",
|
||||
zap.String("address", ms.Address),
|
||||
zap.Int64("serverID", ms.ServerID),
|
||||
)
|
||||
zap.String("role", key))
|
||||
c.grpcClient.SetNodeID(ms.ServerID)
|
||||
return ms.Address, nil
|
||||
}
|
||||
|
||||
// compatible with standalone mode upgrade from 2.5, shoule be removed in 3.0
|
||||
func (c *Client) getCompatibleMixCoordAddr() (string, error) {
|
||||
log := log.Ctx(c.ctx)
|
||||
msess, _, err := c.sess.GetSessions(typeutil.RootCoordRole)
|
||||
if err != nil {
|
||||
log.Debug("mixCoordClient getSessions failed", zap.Any("key", typeutil.RootCoordRole), zap.Error(err))
|
||||
return "", errors.New("find no available mixcoord, check mixcoord state")
|
||||
}
|
||||
ms, ok := msess[typeutil.RootCoordRole]
|
||||
if !ok {
|
||||
log.Warn("MixCoordClient mess key not exist", zap.Any("key", typeutil.RootCoordRole))
|
||||
return "", errors.New("find no available mixcoord, check mixcoord state")
|
||||
}
|
||||
log.Debug("MixCoordClient GetSessions use rootCoord", zap.Any("key", typeutil.RootCoordRole))
|
||||
c.grpcClient.SetNodeID(ms.ServerID)
|
||||
return ms.Address, nil
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user