private boolean removeOldReplicaInfo(ReplicaId replicaId) {
    boolean removalResult = true;
    boolean dataNodeConfigUpdated = false;
    if (!disablePartitionsComplete) {
      // block here until there is a ZNode associated with current node has been created under /PROPERTYSTORE/AdminConfig/
      try {
        awaitDisablingPartition();
      } catch (InterruptedException e) {
        logger.error("Awaiting completion of disabling partition was interrupted. ", e);
        return false;
      }
      disablePartitionsComplete = true;
    }
    DataNodeConfig dataNodeConfig = getDataNodeConfig();
    String partitionName = replicaId.getPartitionId().toPathString();
    boolean removedFromStopped = dataNodeConfig.getStoppedReplicas().remove(partitionName);
    boolean removedFromSealed = dataNodeConfig.getSealedReplicas().remove(partitionName);
    if (removedFromStopped || removedFromSealed) {
      logger.info("Removing partition {} from stopped and sealed list", partitionName);
      dataNodeConfigUpdated = true;
    }
    DataNodeConfig.DiskConfig diskConfig = dataNodeConfig.getDiskConfigs().get(replicaId.getMountPath());
    if (diskConfig != null) {
      dataNodeConfigUpdated = diskConfig.getReplicaConfigs().remove(partitionName) != null;
    }
    if (dataNodeConfigUpdated) {
      logger.info("Updating config in Helix by removing partition {}", partitionName);
      removalResult = dataNodeConfigSource.set(dataNodeConfig);
    } else {
      logger.warn("Partition {} is not found on instance {}, skipping removing it from config in Helix.", partitionName,
          instanceName);
    }
    return removalResult;
  }
Remove old/existing replica info from {@link DataNodeConfig} that associates with current data node.
@param replicaId the {@link ReplicaId} whose info should be removed.
@return {@code true} replica info is successfully removed. {@code false} otherwise.
ambry-clustermap/src/main/java/com/github/ambry/clustermap/HelixParticipant.java