If node is the only one in the custer, skip waiting for data sync
@@ -361,6 +361,7 @@ public class ClusterNode {
setStatus(Status.UPDATING);
+ if (hasAtLeastOneClusterPair(nodeConfig)) {
timer.reset();
try {
logger.info("Starting sync from data stream");
@@ -369,6 +370,9 @@ public class ClusterNode {
} catch (InterruptedException e) {
throw new BootstrapException("Data stream sync interrupted", e);
}
+ } else {
+ logger.info("Data stream sync running in background, force single node cluster start");
+ }
setStatus(Status.UPDATED);
} catch (HostUnreachableException e) {
@@ -417,6 +421,11 @@ public class ClusterNode {
logger.info("Node started in " + (globalTimer.time() / 1000.) + "s");
}
+ private static boolean hasAtLeastOneClusterPair(NodeConfig config) {
+ JoinConfig.Member[] members = config.getNetworkConfig().getJoinConfig().getMembers();
+ return members != null && members.length > 0;
+ }
+
public List<EmbeddedService> getServices() {
return Collections.unmodifiableList(services);
}
