void reconcileSealedStatus() {
    // During startup, we also need to reconcile the replica state from both ZK clusters.
    // reconcile the state by reading sealing state from both clusters
    ReplicaSealStatus sealStatus = resolveReplicaSealStatusFromLogSize();
    String partitionName = replicaId.getPartitionId().toPathString();
    for (ReplicaStatusDelegate replicaStatusDelegate : replicaStatusDelegates) {
      Set<String> sealedReplicas = new HashSet<>(replicaStatusDelegate.getSealedReplicas());
      Set<String> partiallySealedReplicas = new HashSet<>(replicaStatusDelegate.getPartiallySealedReplicas());
      ReplicaSealStatus delegateSealStatus = sealedReplicas.contains(partitionName) ? ReplicaSealStatus.SEALED
          : (partiallySealedReplicas.contains(partitionName) ? ReplicaSealStatus.PARTIALLY_SEALED
              : ReplicaSealStatus.NOT_SEALED);
      sealStatus = ReplicaSealStatus.mergeReplicaSealStatus(sealStatus, delegateSealStatus);
    }
    boolean success = false;
    for (ReplicaStatusDelegate replicaStatusDelegate : replicaStatusDelegates) {
      switch (sealStatus) {
        case SEALED:
          success = replicaStatusDelegate.seal(replicaId);
          break;
        case PARTIALLY_SEALED:
          success = replicaStatusDelegate.partialSeal(replicaId);
          break;
        case NOT_SEALED:
          success = replicaStatusDelegate.unseal(replicaId);
          break;
      }
    }
    if (success) {
      logger.info("Succeeded in reconciling replica state to {} state", sealStatus.name());
      replicaSealStatus.set(sealStatus);
    } else {
      logger.error("Failed on reconciling replica state to {} state", sealStatus.name());
    }
  }
Reconcile the sealed status of the replica during startup.
ambry-store/src/main/java/com/github/ambry/store/BlobStore.java