@Override
  public boolean test(SyncReplicationState state, SyncReplicationState newState) {
    // Forbid major compaction when cluster transit sync replication state from S to DA
    return state == SyncReplicationState.STANDBY
      || newState == SyncReplicationState.DOWNGRADE_ACTIVE;
  }
Check whether forbid major compaction for region.
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/compactions/ForbidMajorCompactionChecker.java