diff --git a/src/main/java/com/actiontech/dble/server/variables/VarsExtractorHandler.java b/src/main/java/com/actiontech/dble/server/variables/VarsExtractorHandler.java index 020e7dffe9..8e172dad48 100644 --- a/src/main/java/com/actiontech/dble/server/variables/VarsExtractorHandler.java +++ b/src/main/java/com/actiontech/dble/server/variables/VarsExtractorHandler.java @@ -7,6 +7,7 @@ import com.actiontech.dble.backend.datasource.PhysicalDbGroup; import com.actiontech.dble.backend.datasource.PhysicalDbInstance; +import com.actiontech.dble.config.model.SystemConfig; import com.actiontech.dble.singleton.TraceManager; import com.actiontech.dble.sqlengine.OneRawSQLQueryResultHandler; import com.actiontech.dble.sqlengine.OneTimeConnJob; @@ -79,6 +80,21 @@ private PhysicalDbInstance getPhysicalDbInstance() { } } } + + if (ds == null && SystemConfig.getInstance().isSkipTestConOnUpdate()) { + for (PhysicalDbGroup dbGroup : dbGroups.values()) { + for (PhysicalDbInstance dsTest : dbGroup.getDbInstances(true)) { + //this DbInstance should use createConnectionSkipPool + if (dsTest.isTestConnSuccess()) { + ds = dsTest; + break; + } + } + if (ds != null) { + break; + } + } + } return ds; }