File tree Expand file tree Collapse file tree 3 files changed +14
-4
lines changed
src/main/java/com/actiontech/dble Expand file tree Collapse file tree 3 files changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -271,7 +271,12 @@ private void pullVarAndMeta() throws IOException {
271
271
if (!this .getConfig ().isDataHostWithoutWR ()) {
272
272
//init for sys VAR
273
273
VarsExtractorHandler handler = new VarsExtractorHandler (config .getDataHosts ());
274
- systemVariables = handler .execute ();
274
+ SystemVariables newSystemVariables = handler .execute ();
275
+ if (newSystemVariables == null ) {
276
+ throw new IOException ("Can't get variables from data node" );
277
+ } else {
278
+ systemVariables = newSystemVariables ;
279
+ }
275
280
reviseSchemas ();
276
281
initDataHost ();
277
282
//init tmManager
Original file line number Diff line number Diff line change 43
43
import org .slf4j .Logger ;
44
44
import org .slf4j .LoggerFactory ;
45
45
46
+ import java .io .IOException ;
46
47
import java .nio .charset .StandardCharsets ;
47
48
import java .util .ArrayList ;
48
49
import java .util .List ;
@@ -274,10 +275,13 @@ public static void reloadAll(final int loadAllMode) throws Exception {
274
275
Map <ERTable , Set <ERTable >> newErRelations = loader .getErRelations ();
275
276
FirewallConfig newFirewall = loader .getFirewall ();
276
277
277
- SystemVariables newSystemVariables = DbleServer . getInstance (). getSystemVariables () ;
278
+ SystemVariables newSystemVariables = null ;
278
279
if (!loader .isDataHostWithoutWH ()) {
279
280
VarsExtractorHandler handler = new VarsExtractorHandler (newDataHosts );
280
281
newSystemVariables = handler .execute ();
282
+ if (newSystemVariables == null ) {
283
+ throw new IOException ("Can't get variables from data node" );
284
+ }
281
285
ConfigInitializer confInit = new ConfigInitializer (newSystemVariables .isLowerCaseTableNames ());
282
286
newUsers = confInit .getUsers ();
283
287
newSchemas = confInit .getSchemas ();
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ public class VarsExtractorHandler {
27
27
private Lock lock ;
28
28
private Condition done ;
29
29
private Map <String , PhysicalDBPool > dataHosts ;
30
- private SystemVariables systemVariables = new SystemVariables () ;
30
+ private volatile SystemVariables systemVariables = null ;
31
31
public VarsExtractorHandler (Map <String , PhysicalDBPool > dataHosts ) {
32
32
this .dataHosts = dataHosts ;
33
33
this .extracting = false ;
@@ -77,7 +77,8 @@ private PhysicalDatasource getPhysicalDatasource() {
77
77
return ds ;
78
78
}
79
79
80
- public void handleVars (Map <String , String > vars ) {
80
+ void handleVars (Map <String , String > vars ) {
81
+ systemVariables = new SystemVariables ();
81
82
for (Map .Entry <String , String > entry : vars .entrySet ()) {
82
83
String key = entry .getKey ();
83
84
String value = entry .getValue ();
You can’t perform that action at this time.
0 commit comments