@Override
  protected void afterReplay(MasterProcedureEnv env) {
    // For these two states, we need to register the peer to the replay manager, as the state are
    // only kept in memory and will be lost after restarting. And in
    // SyncReplicationReplayWALProcedure.afterReplay we will reconstruct the used workers.
    switch (getCurrentState()) {
      case DISPATCH_WALS:
      case UNREGISTER_PEER_FROM_WORKER_STORAGE:
        env.getMasterServices().getSyncReplicationReplayWALManager().registerPeer(peerId);
        break;
      default:
        break;
    }
  }
The procedure for replaying all the remote wals for transitting a sync replication peer from
STANDBY to DOWNGRADE_ACTIVE.
hbase-server/src/main/java/org/apache/hadoop/hbase/master/replication/RecoverStandbyProcedure.java