@Override
  public void onPartitionBecomeOfflineFromInactive(String partitionName) {
    participantMetrics.incStateTransitionMetric(partitionName, ReplicaState.INACTIVE, ReplicaState.OFFLINE);
    PartitionStateChangeListener replicationManagerListener =
        partitionStateChangeListeners.get(StateModelListenerType.ReplicationManagerListener);
    try {
      if (replicationManagerListener != null) {
        // 1. take actions in replication manager
        //    (1) set local store state to OFFLINE
        //    (2) initiate disconnection in ReplicaSyncUpManager
        replicationManagerListener.onPartitionBecomeOfflineFromInactive(partitionName);
        // 2. wait until peer replicas have caught up with local replica
        // TODO considering moving wait disconnection logic into replication manager listener
        replicaSyncUpManager.waitDisconnectionCompleted(partitionName);
      }
      // 3. take actions in storage manager (stop the store and update instanceConfig)
      PartitionStateChangeListener storageManagerListener =
          partitionStateChangeListeners.get(StateModelListenerType.StorageManagerListener);
      if (storageManagerListener != null) {
        storageManagerListener.onPartitionBecomeOfflineFromInactive(partitionName);
      }
    } catch (InterruptedException e) {
      logger.error("Disconnection was interrupted on partition {}", partitionName);
      localPartitionAndState.put(partitionName, ReplicaState.ERROR);
      throw new StateTransitionException("Disconnection failed or was interrupted", DisconnectionFailure);
    } catch (StateTransitionException e) {
      logger.error("Exception occurred during Inactive-To-Offline transition ", e);
      localPartitionAndState.put(partitionName, ReplicaState.ERROR);
      throw e;
    }
    localPartitionAndState.put(partitionName, ReplicaState.OFFLINE);
    participantMetrics.decStateTransitionMetric(partitionName, ReplicaState.INACTIVE, ReplicaState.OFFLINE);
  }
If FileCopyProtocol is enabled, we will invoke the FileCopyStateChangeListener
ambry-clustermap/src/main/java/com/github/ambry/clustermap/HelixParticipant.java