private void checkShouldRejectReplicationRequest(List<WALEntry> entries) throws IOException {
    ReplicationSourceService replicationSource = server.getReplicationSourceService();
    if (replicationSource == null || entries.isEmpty()) {
      return;
    }
    // We can ensure that all entries are for one peer, so only need to check one entry's
    // table name. if the table hit sync replication at peer side and the peer cluster
    // is (or is transiting to) state ACTIVE or DOWNGRADE_ACTIVE, we should reject to apply
    // those entries according to the design doc.
    TableName table = TableName.valueOf(entries.get(0).getKey().getTableName().toByteArray());
    if (
      replicationSource.getSyncReplicationPeerInfoProvider().checkState(table,
        RejectReplicationRequestStateChecker.get())
    ) {
      throw new DoNotRetryIOException(
        "Reject to apply to sink cluster because sync replication state of sink cluster "
          + "is ACTIVE or DOWNGRADE_ACTIVE, table: " + table);
    }
  }
Replay the given changes on a secondary replica
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java