Pavlin Radoslavov

Revert "Wait for a raft quorum + logging a message to inform about the wait"

Reverting-back for further investigation.

This reverts commit d2f457b8.

Change-Id: I83d2c171fd26e4008c0fd36ed635993eb18b3718
...@@ -224,20 +224,16 @@ public class DatabaseManager implements DatabaseService, DatabaseAdminService { ...@@ -224,20 +224,16 @@ public class DatabaseManager implements DatabaseService, DatabaseAdminService {
224 clusterEventListener = new InternalClusterEventListener(); 224 clusterEventListener = new InternalClusterEventListener();
225 clusterService.addListener(clusterEventListener); 225 clusterService.addListener(clusterEventListener);
226 226
227 - final int raftClusterSize = clusterConfig.getMembers().size(); 227 + if (clusterService.getNodes().size() < clusterConfig.getMembers().size()) {
228 - final int raftClusterQuorumSize = (int) (Math.floor(raftClusterSize / 2)) + 1;
229 - if (clusterService.getNodes().size() < raftClusterQuorumSize) {
230 // current cluster size smaller then expected 228 // current cluster size smaller then expected
231 try { 229 try {
232 - final int waitTimeSec = 120; 230 + if (!clusterEventLatch.await(120, TimeUnit.SECONDS)) {
233 - log.info("Waiting for a maximum of {}s for raft cluster quorum to boot up...", waitTimeSec);
234 - if (!clusterEventLatch.await(waitTimeSec, TimeUnit.SECONDS)) {
235 log.info("Starting with {}/{} nodes cluster", 231 log.info("Starting with {}/{} nodes cluster",
236 clusterService.getNodes().size(), 232 clusterService.getNodes().size(),
237 - raftClusterSize); 233 + clusterConfig.getMembers().size());
238 } 234 }
239 } catch (InterruptedException e) { 235 } catch (InterruptedException e) {
240 - log.info("Interrupted waiting for raft quorum.", e); 236 + log.info("Interrupted waiting for others", e);
241 } 237 }
242 } 238 }
243 } 239 }
......