saintstack commented on a change in pull request #435: HBASE-22767 System table 
RIT STUCK if their RSGroup has no highest ve…
URL: https://github.com/apache/hbase/pull/435#discussion_r324429440
 
 

 ##########
 File path: 
hbase-rsgroup/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroupsKillRS.java
 ##########
 @@ -224,4 +228,54 @@ public void testKillAllRSInGroup() throws Exception {
     // wait and check if table regions are online
     TEST_UTIL.waitTableAvailable(tableName, 30000);
   }
+
+  @Test
+  public void testLowerMetaGroupVersion() throws Exception{
+    // create a rsgroup and move one regionserver to it
+    String groupName = "meta_group";
+    int groupRSCount = 1;
+    addGroup(groupName, groupRSCount);
+
+    // move hbase:meta to meta_group
+    tableName = TableName.META_TABLE_NAME;
+    Set<TableName> toAddTables = new HashSet<>();
+    toAddTables.add(tableName);
+    rsGroupAdmin.moveTables(toAddTables, groupName);
+    
assertTrue(rsGroupAdmin.getRSGroupInfo(groupName).getTables().contains(tableName));
+    TEST_UTIL.waitTableAvailable(tableName, 30000);
+
+    // restart the regionserver in meta_group, and lower its version
+    String originVersion = "";
+    Set<Address> servers = new HashSet<>();
+    for(Address addr : rsGroupAdmin.getRSGroupInfo(groupName).getServers()) {
+      servers.add(addr);
+      TEST_UTIL.getMiniHBaseCluster().stopRegionServer(getServerName(addr));
+      originVersion = master.getRegionServerVersion(getServerName(addr));
+    }
+    // better wait for a while for region reassign
+    sleep(10000);
+    assertEquals(NUM_SLAVES_BASE - groupRSCount,
+        TEST_UTIL.getMiniHBaseCluster().getLiveRegionServerThreads().size());
+    Address address = servers.iterator().next();
+    int majorVersion = Integer.parseInt(originVersion.split("\\.")[0]);
 
 Review comment:
   Add a method to the VersionInfo getMajorVersion ?

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

Reply via email to