protected boolean isQuorumMaintained(){
  if (nodeCount == 1) {
    log.info("There's no way to maintain quorum on single node deployments. Proceed anyway.");
    return true;
  }
  int quorumNodeCnt=nodeCount / 2 + 1;
  CoordinatorClient coordinatorClient=coordinator.getCoordinatorClient();
  List<Service> allActiveDbsvcs=coordinatorClient.locateAllSvcsAllVers(Constants.DBSVC_NAME);
  List<String> otherActiveDbsvcIds=new ArrayList<>();
  String mySvcId=coordinator.getMySvcId();
  String localDbSvcId="db" + mySvcId.substring(mySvcId.lastIndexOf("-"));
  for (  Service activeDbsvc : allActiveDbsvcs) {
    if (!localDbSvcId.equals(activeDbsvc.getId())) {
      otherActiveDbsvcIds.add(activeDbsvc.getId());
    }
  }
  log.info("List of active dbsvc instances on other nodes: {}, expect {} instances to maintain quorum",otherActiveDbsvcIds,quorumNodeCnt);
  boolean isMaintained=otherActiveDbsvcIds.size() >= quorumNodeCnt;
  if (!isMaintained) {
    log.info("quorum would lost if reboot the current node. Retrying...");
  }
  return isMaintained;
}

protected boolean isQuorumMaintained ( ) { if ( nodeCount == 1 ) { log . info ( "There's no way to maintain quorum on single node deployments. Proceed anyway." ) ; return true ; } int quorumNodeCnt = nodeCount / 2 + 1 ; CoordinatorClient coordinatorClient = coordinator . getCoordinatorClient ( ) ; List < Service > allActiveDbsvcs = coordinatorClient . locateAllSvcsAllVers ( Constants . DBSVC_NAME ) ; List < String > otherActiveDbsvcIds = new ArrayList < > ( ) ; String mySvcId = coordinator . getMySvcId ( ) ; String localDbSvcId = "db" + mySvcId . substring ( mySvcId . lastIndexOf ( "-" ) ) ; for ( Service activeDbsvc : allActiveDbsvcs ) { if ( ! localDbSvcId . equals ( activeDbsvc . getId ( ) ) ) { otherActiveDbsvcIds . add ( activeDbsvc . getId ( ) ) ; } } log . info ( "List of active dbsvc instances on other nodes: {}, expect {} instances to maintain quorum" , otherActiveDbsvcIds , quorumNodeCnt ) ; boolean isMaintained = otherActiveDbsvcIds . size ( ) >= quorumNodeCnt ; if ( ! isMaintained ) { log . info ( "quorum would lost if reboot the current node. Retrying..." ) ; } return isMaintained ; }
check if node_count / 2 + 1 dbsvc instances are active on other nodes in the cluster so that if the current node is powered off , a quorum will still be maintained .
