mirror of
https://github.com/actiontech/dble.git
synced 2025-12-30 09:20:16 -06:00
inner-2407-supplement : upload metadata for switch
This commit is contained in:
@@ -37,6 +37,7 @@ public final class DbGroupHaSwitch {
|
||||
final ReentrantReadWriteLock lock = DbleServer.getInstance().getConfig().getLock();
|
||||
lock.readLock().lock();
|
||||
try {
|
||||
ClusterHelper clusterHelper = ClusterHelper.getInstance(ClusterOperation.HA);
|
||||
HaConfigManager.getInstance().info("added configLock");
|
||||
PhysicalDbGroup dh = DbleServer.getInstance().getConfig().getDbGroups().get(dbGroupName);
|
||||
if (dh == null) {
|
||||
@@ -59,6 +60,11 @@ public final class DbGroupHaSwitch {
|
||||
try {
|
||||
//dble start in single mode
|
||||
RawJson result = dh.switchMaster(masterName, true);
|
||||
|
||||
if (ClusterConfig.getInstance().isClusterEnable()) {
|
||||
clusterHelper.setKV(ClusterMetaUtil.getHaStatusPath(dh.getGroupName()), result);
|
||||
}
|
||||
|
||||
HaConfigManager.getInstance().haFinish(id, null, result);
|
||||
} catch (Exception e) {
|
||||
packetResult.setSuccess(false);
|
||||
|
||||
Reference in New Issue
Block a user