dropnode时候主动给主节点设置为MASTER_INSTANCE

This commit is contained in:
zhang_xubo
2023-11-29 14:16:29 +08:00
parent 367eb112b3
commit 3e389c4415

View File

@ -236,6 +236,10 @@ class DropnodeImpl():
self.context.clusterInfo.dbNodes.remove(dnLoop)
for dbNode in self.context.clusterInfo.dbNodes:
if dbNode.name == self.localhostname:
# dropnode only allow executed on primary node
# instanceType should change to master while the cluster had switchover
if len(dbNode.datanodes) > 0:
dbNode.datanodes[0].instanceType = MASTER_INSTANCE
self.context.clusterInfo.saveToStaticConfig(staticConfigPath,
dbNode.id)
continue