@Override
  public boolean updateReplicaLagAndCheckSyncStatus(ReplicaId localReplica, ReplicaId peerReplica, long lagInBytes,
      ReplicaState targetState) {
    updateLock.lock();
    try {
      boolean syncUpCompleted = false;
      LocalReplicaLagInfos lagInfos = replicaToLagInfos.get(localReplica);
      if (lagInfos != null) {
        lagInfos.updateLagInfo(peerReplica, lagInBytes);
        if (logger.isDebugEnabled()) {
          logger.debug(lagInfos.toString());
        }
        if (isSyncUpComplete(localReplica)) {
          switch (targetState) {
            case STANDBY:
              onBootstrapComplete(localReplica);
              break;
            case INACTIVE:
              onDeactivationComplete(localReplica);
              break;
            case OFFLINE:
              onDisconnectionComplete(localReplica);
              break;
            default:
              throw new IllegalArgumentException("Invalid target replica state for SyncUpManager: " + targetState);
          }
          syncUpCompleted = true;
        }
      }
      return syncUpCompleted;
    } finally {
      updateLock.unlock();
    }
  }
{@inheritDoc}
The method is blocked on a {@link java.util.concurrent.CountDownLatch} until the bootstrap is complete
ambry-clustermap/src/main/java/com/github/ambry/clustermap/AmbryReplicaSyncUpManager.java