mnpoonia commented on PR #5799:
URL: https://github.com/apache/hbase/pull/5799#issuecomment-2041544428

   If it matters i test with very rudimentary way
   Changed MergeTableRegionProcedure method 
   ```
   private TransitRegionStateProcedure[] 
createUnassignProcedures(MasterProcedureEnv env)
       throws IOException {
       LOG.info("Aman: Inside our target method");
       boolean tesTable =
         
regionsToMerge[0].getTable().getNameAsString().equals("testRollbackAfter4AndDoubleExecution");
       if (tesTable) {
         LOG.info("Aman test");
         throw new HBaseIOException(
           "The parent region " + regionsToMerge[0].getEncodedName() + " is 
currently in transition, give up");
       }
       return AssignmentManagerUtil.createUnassignProceduresForSplitOrMerge(env,
         Stream.of(regionsToMerge), getRegionReplication(env));
     }
   ```
   
   The  wrote test as below
   ```
   @Test
     public void testMergeFailureBeforeClosing() throws Exception {
       final TableName tableName = 
TableName.valueOf("testRollbackAfter4AndDoubleExecution");
       final ProcedureExecutor<MasterProcedureEnv> procExec = 
getMasterProcedureExecutor();
   
       List<RegionInfo> tableRegions = createTable(tableName);
   
       ProcedureTestingUtility.waitNoProcedureRunning(procExec);
   
       RegionInfo[] regionsToMerge = new RegionInfo[2];
       regionsToMerge[0] = tableRegions.get(0);
       regionsToMerge[1] = tableRegions.get(1);
   
       long procId = procExec.submitProcedure(
         new MergeTableRegionsProcedure(procExec.getEnvironment(), 
regionsToMerge, true));
   
       ProcedureTestingUtility.waitProcedure(procExec, procId);
       UTIL.waitUntilAllRegionsAssigned(tableName);
       List<HRegion> regions = UTIL.getMiniHBaseCluster().getRegions(tableName);
       assertEquals(initialRegionCount, regions.size());
     }
   ```
   And test were not getting stuck and going through after the above fix and 
were getting stuck if we remove this patch.
   
   @Apache9 FYI


-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to