From 039e15014b9e64142a3b604acc6cdc49b4f8d701 Mon Sep 17 00:00:00 2001 From: dcy Date: Fri, 17 May 2024 10:24:10 +0800 Subject: [PATCH] inner-2388: modify default value of skipTestConOnUpdate &fix 2383 bug --- .../java/com/actiontech/dble/config/ConfigInitializer.java | 7 ++----- .../com/actiontech/dble/config/model/SystemConfig.java | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/actiontech/dble/config/ConfigInitializer.java b/src/main/java/com/actiontech/dble/config/ConfigInitializer.java index 48dfdac0a8..913f72c709 100644 --- a/src/main/java/com/actiontech/dble/config/ConfigInitializer.java +++ b/src/main/java/com/actiontech/dble/config/ConfigInitializer.java @@ -204,10 +204,7 @@ public void testConnection() { boolean skipTestConnectionOnUpdate = false; if (SystemConfig.getInstance().isSkipTestConOnUpdate()) { if (reloadContext != null && !reloadContext.getAffectDbInstanceList().isEmpty()) { - if (reloadContext.getConfStatus() == ConfStatus.Status.MANAGER_DELETE) { - skipTestConnectionOnUpdate = true; - LOGGER.info("will skip all test connection."); - } else { + if (reloadContext.getConfStatus() != ConfStatus.Status.MANAGER_DELETE) { boolean useSharding = reloadContext.getAffectDbInstanceList().stream().map(ele -> dbGroups.get(ele.getGroupName())).anyMatch((ele) -> ele != null && !ele.isShardingUseless()); //not support for sharding db group @@ -246,7 +243,7 @@ public void testConnection() { boolean find = reloadContext.getAffectDbInstanceList().stream().anyMatch((ele) -> ele.getGroupName().equals(finalDbGroupName) && ele.getInstanceName().equals(ds.getName())); if (!find) { //skip test connection on this dbInstance - ds.setTestConnSuccess(true); + ds.setTestConnSuccess(false); LOGGER.info("dbGroup[" + ds.getDbGroupConfig().getName() + "] instance " + ds.getName() + " is skiped,because of option skipTestConOnUpdate"); continue; } diff --git a/src/main/java/com/actiontech/dble/config/model/SystemConfig.java b/src/main/java/com/actiontech/dble/config/model/SystemConfig.java index 26c272e77e..a6b4de5635 100644 --- a/src/main/java/com/actiontech/dble/config/model/SystemConfig.java +++ b/src/main/java/com/actiontech/dble/config/model/SystemConfig.java @@ -71,7 +71,7 @@ private SystemConfig() { private int useCostTimeStat = 0; private int maxCostStatSize = 100; private int costSamplePercent = 1; - private boolean skipTestConOnUpdate = false; + private boolean skipTestConOnUpdate = true; //connection private String charset = "utf8mb4"; private int maxPacketSize = 4 * 1024 * 1024;