sunhelly commented on a change in pull request #323: HBASE-22414 Interruption
of moving regions in RSGroup will cause regi…
URL: https://github.com/apache/hbase/pull/323#discussion_r302397751
##########
File path:
hbase-rsgroup/src/test/java/org/apache/hadoop/hbase/rsgroup/TestRSGroupsAdmin2.java
##########
@@ -459,4 +464,250 @@ public boolean evaluate() throws Exception {
Assert.assertEquals(null, rsGroupAdmin.getRSGroupInfo(fooGroup.getName()));
}
+ @Test
+ public void testFailedMoveBeforeRetryExhaustedWhenMoveServer() throws
Exception {
+ String groupName = getGroupName(name.getMethodName());
+ rsGroupAdmin.addRSGroup(groupName);
+ final RSGroupInfo newGroup = rsGroupAdmin.getRSGroupInfo(groupName);
+ final byte[] familyNameBytes = Bytes.toBytes("f");
+ final int tableRegionCount = 10;
+ // All the regions created below will be assigned to the default group.
+ TEST_UTIL.createMultiRegionTable(tableName, familyNameBytes,
tableRegionCount);
+ TEST_UTIL.waitFor(WAIT_TIMEOUT, new Waiter.Predicate<Exception>() {
+ @Override
+ public boolean evaluate() throws Exception {
+ List<String> regions = getTableRegionMap().get(tableName);
+ if (regions == null) {
+ return false;
+ }
+ return getTableRegionMap().get(tableName).size() >= tableRegionCount;
+ }
+ });
+
+ Pair<ServerName, RegionStateNode> gotPair = setARegionState(newGroup);
+
+ // start thread to recover region state
+ final ServerName movedServer = gotPair.getFirst();
+ final RegionStateNode rsn = gotPair.getSecond();
+ AtomicBoolean changed = new AtomicBoolean(false);
+ Thread t1 = new Thread(() -> {
+ LOG.debug("thread1 start running, will recover region state");
+ long current = System.currentTimeMillis();
+ while (System.currentTimeMillis() - current <= 50000) {
Review comment:
I have defined the constant DEFAULT_MAX_RETRY_VALUE and used it here in the
last patch.
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services