private void removeCloudReplica(String partitionName) {
    // Removing cloud replica occurs when replica from LEADER to STANDBY (this may be triggered by "Move Replica" or
    // regular leadership hand-off due to server deployment). No matter what triggers this transition, the local replica
    // should be present in storage manager at this point of time.
    ReplicaId localReplica = storeManager.getReplica(partitionName);
    if (localReplica == null) {
      logger.warn("Attempting to remove cloud partition {} that is not present on the node", partitionName);
      return;
    }
    PartitionId partitionId = localReplica.getPartitionId();
    stopPartitionReplication(partitionId);
    replicationMetrics.removeLagMetricForPartition(partitionId);
    logger.info("Cloud Partition {} removed from {}", partitionId, dataNodeId);
  }
Remove a replica of given partition and its {@link RemoteReplicaInfo}s from the backup list.
@param partitionName the partition of the replica to be removed.
ambry-cloud/src/main/java/com/github/ambry/cloud/RecoveryManager.java