Skip to content

Commit

Permalink
inner-2405:can use slave connection when rwSplitMode=0.
Browse files Browse the repository at this point in the history
  • Loading branch information
dcy10000 committed Sep 13, 2024
1 parent 9f2f150 commit e94e29d
Showing 1 changed file with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit e94e29d

Please sign in to comment.