From cc41922b95d33b385f4372c6d69efddf5dbca583 Mon Sep 17 00:00:00 2001 From: leonrayang Date: Wed, 24 Aug 2022 16:04:04 +0800 Subject: [PATCH] update: update metanode or datanode id need drop old one before Signed-off-by: leonrayang --- master/cluster.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/master/cluster.go b/master/cluster.go index b953efa5f9..284d4d9d5d 100644 --- a/master/cluster.go +++ b/master/cluster.go @@ -572,6 +572,9 @@ func (c *Cluster) updateDataNodeBaseInfo(nodeAddr string, id uint64) (err error) return } + if err = c.syncDeleteDataNode(dataNode); err != nil { + return + } dataNode.ID = id if err = c.syncUpdateDataNode(dataNode); err != nil { return @@ -592,7 +595,9 @@ func (c *Cluster) updateMetaNodeBaseInfo(nodeAddr string, id uint64) (err error) if metaNode.ID == id { return } - + if err = c.syncDeleteMetaNode(metaNode); err != nil { + return + } metaNode.ID = id if err = c.syncUpdateMetaNode(metaNode); err != nil { return