@Override
    public void onPartitionBecomeInactiveFromStandby(String partitionName) {
      // if code arrives here, we don't need to check if replica exists, it has been checked in StorageManager
      ReplicaId localReplica = storeManager.getReplica(partitionName);
      Store store = storeManager.getStore(localReplica.getPartitionId());
      // 1. check if store is started
      if (store == null) {
        throw new StateTransitionException(
            "Store " + partitionName + " is not started during Standby-To-Inactive transition", StoreNotStarted);
      }
      if (!store.isEmpty()) {
        // Wait for peers to sync up if this replica is not empty
        replicaSyncUpManager.initiateDeactivation(localReplica);
      }
    }
{@link PartitionStateChangeListener} to capture changes in partition state.
ambry-replication/src/main/java/com/github/ambry/replication/ReplicationManager.java