Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-20160

TestRestartCluster.testRetainAssignmentOnRestart uses the wrong condition to decide whether the assignment is finished

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.0.0
    • Component/s: Region Assignment
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

          // Wait till master is initialized and all regions are assigned
          RegionStates regionStates = master.getAssignmentManager().getRegionStates();
          int expectedRegions = regionToRegionServerMap.size() + 1;
          while (!master.isInitialized()
              || regionStates.getRegionAssignments().size() != expectedRegions) {
            Threads.sleep(100);
          }
      

      Actually this does not mean the assignment is finished. In AMv2, we will load the region state from meta when restarting, so the regionStates.getRegionAssignments will reach the expected count soon. But this is just the old location. After that, we will continue to execute the ServerCrashProcedure to deal with the reassignment. That's why sometimes we may fail with

      java.lang.AssertionError: Values should be different. Actual: 1520478964169
      	at org.apache.hadoop.hbase.master.TestRestartCluster.testRetainAssignmentOnRestart(TestRestartCluster.java:215)
      

      We just read the old location from meta since the ServerCrashProcedure has not been finished yet, but we want to confirm that the region is on the same host and port but a new RS.

        Attachments

        1. HBASE-20160.patch
          5 kB
          Duo Zhang

          Activity

            People

            • Assignee:
              zhangduo Duo Zhang
              Reporter:
              zhangduo Duo Zhang
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: