Apache9 commented on a change in pull request #1018: HBASE-23652 Move the unsupported procedure type check before migratin… URL: https://github.com/apache/hbase/pull/1018#discussion_r367259124
########## File path: hbase-server/src/main/java/org/apache/hadoop/hbase/procedure2/store/region/RegionProcedureStore.java ########## @@ -298,6 +307,45 @@ private HRegion open(Configuration conf, FileSystem fs, Path rootDir) throws IOE null); } + @SuppressWarnings("deprecation") + private static final ImmutableSet<Class<?>> UNSUPPORTED_PROCEDURES = + ImmutableSet.of(RecoverMetaProcedure.class, AssignProcedure.class, UnassignProcedure.class, + MoveRegionProcedure.class); + + /** + * In HBASE-20811, we have introduced a new TRSP to assign/unassign/move regions, and it is + * incompatible with the old AssignProcedure/UnassignProcedure/MoveRegionProcedure. So we need to + * make sure that there are none these procedures when upgrading. If there are, the master will + * quit, you need to go back to the old version to finish these procedures first before upgrading. + */ + private void checkUnsupportedProcedure(Map<Class<?>, List<Procedure<?>>> procsByType) + throws HBaseIOException { + // Confirm that we do not have unfinished assign/unassign related procedures. It is not easy to + // support both the old assign/unassign procedures and the new TransitRegionStateProcedure as + // there will be conflict in the code for AM. We should finish all these procedures before + // upgrading. + for (Class<?> clazz : UNSUPPORTED_PROCEDURES) { + List<Procedure<?>> procs = procsByType.get(clazz); + if (procs != null) { + LOG.error( + "Unsupported procedure type {} found, please rollback your master to the old" + + " version to finish them, and then try to upgrade again. The full procedure list: {}", + clazz, procs); + throw new HBaseIOException("Unsupported procedure type " + clazz + " found"); + } + } + // A special check for SCP, as we do not support RecoverMetaProcedure any more so we need to + // make sure that no one will try to schedule it but SCP does have a state which will schedule + // it. + if (procsByType.getOrDefault(ServerCrashProcedure.class, Collections.emptyList()).stream() Review comment: Just use eclipse formatter and it will make them in the same line if possible... ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services