@Override
    public void onPartitionBecomeLeaderFromStandby(String partitionName) {
      logger.info("Partition state change notification from Standby to Leader received for partition {}",
          partitionName);
      if (shouldReplicatePartition(partitionName)) {
        synchronized (notificationLock) {
          try {
            addCloudReplica(partitionName);
          } catch (Exception rex) {
            logger.error("Exception {} while adding replication for partition {}", rex, partitionName);
            recoveryMetrics.addCloudPartitionErrorCount.inc();
          }
        }
      }
    }
{@link PartitionStateChangeListener} to capture changes in partition state.
ambry-cloud/src/main/java/com/github/ambry/cloud/RecoveryManager.java