Skip to content
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
5e84291
HBASE-22537 Split happened Replica region can not be deleted after de…
sreenivasulureddy Jun 14, 2019
cad5ec3
HBASE-22537 Minor suggestion to SREENIVASULU's original fix proposal
wchevreuil Jun 14, 2019
41da963
moved test to TestSplitOrMergeStatus, removed unused variables and co…
wchevreuil Jul 2, 2019
e8893c8
cleaning out imports changes introduced on this PR.
wchevreuil Jul 2, 2019
8bc7636
HBASE-22537 Split happened Replica region can not be deleted after de…
sreenivasulureddy Jun 14, 2019
b61ac0d
Merge branch 'HBASE-22537' of github.com:wchevreuil/hbase into HBASE-…
wchevreuil Jul 3, 2019
2273ace
reverting line break change on SplitTableRegionProcedure. Checkstyle …
wchevreuil Jul 3, 2019
5b7c87a
HBASE-22593 Added Jenv file to gitignore (#314)
HorizonNet Jun 17, 2019
0de4c4c
HBASE-22581 user with "CREATE" permission can grant, but not revoke p…
stoty Jun 14, 2019
a883f1d
HBASE-22344 Documented the deprecation of public and limited private …
HorizonNet Jun 17, 2019
be06209
HBASE-22561 modify HFilePrettyPrinter to accept non-rootdir directories
dbist Jun 18, 2019
1dc0a2b
HBASE-22596 [Chore] Separate the execution period between CompactionC…
Reidddddd Jun 18, 2019
85eb24a
HBASE-22605 Ref guide includes dev guidance only applicable to EOM ve…
liuml07 Jun 19, 2019
474cbc2
HBASE-22520 Avoid possible NPE while performing seekBefore in Hal… (#…
virajjasani Jun 6, 2019
96e3b3f
HBASE-22615 Make TestChoreService more robust to timing
busbey Jun 22, 2019
298f135
HBASE-22616 responseTooXXX logging for Multi should characterize the …
apurtell Jun 25, 2019
cef3727
HBASE-22617 Recovered WAL directories not getting cleaned up (#330)
Apache9 Jun 25, 2019
f9da07f
HBASE-22632 SplitTableRegionProcedure and MergeTableRegionsProcedure …
Apache9 Jun 27, 2019
0c0b3a1
HBASE-22595 Changed suppressions to full qualified class name
HorizonNet Jun 28, 2019
402e664
HBASE-22633 remove redundant substring call with append for ZKReplica…
virajjasani Jun 28, 2019
f56bd6c
HBASE-20368 Fix RIT stuck when a rsgroup has no online servers but AM…
sunhelly Apr 11, 2018
988c681
HBASE-22169 Open region failed cause memory leak
luffygod Jul 1, 2019
faf229b
HBASE-22477 Throwing exception when meta region is not in OPEN state …
Apache9 Jun 8, 2019
f5a4cd0
HBASE-21751 WAL creation fails during region open may cause region as…
luffygod Jul 2, 2019
fb02877
HBASE-22637 fix flaky test in TestMetaTableMetrics
symat Jul 2, 2019
765fe9e
HBASE-13798 TestFromClientSide* don't close the Table
anmolnar Jul 2, 2019
a001e00
HBASE-22652 Flakey TestLockManager; test timed out after 780 seconds
saintstack Jul 3, 2019
4109c13
HBASE-22604 fix the link in the docs to "Understanding HBase and BigT…
murtazahassan123 Jul 3, 2019
1b26f7e
Merge branch 'branch-2.1' into HBASE-22537
wchevreuil Jul 3, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -854,7 +854,8 @@ private UnassignProcedure[] createUnassignProcedures(final MasterProcedureEnv en
for (int i = 0; i < procs.length; ++i) {
final RegionInfo hri = RegionReplicaUtil.getRegionInfoForReplica(getParentRegion(), i);
procs[i] = env.getAssignmentManager().
createUnassignProcedure(hri, null, true, !RegionReplicaUtil.isDefaultReplica(hri));
createUnassignProcedure(hri, null, true,
!RegionReplicaUtil.isDefaultReplica(hri));
Comment thread
wchevreuil marked this conversation as resolved.
Outdated
}
return procs;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ protected void finishTransition(final MasterProcedureEnv env, final RegionStateN
} else {
// Remove from in-memory states
am.getRegionStates().deleteRegion(regionInfo);
am.getRegionStates().removeRegionFromServer(regionNode.getRegionLocation(), regionNode);
env.getMasterServices().getServerManager().removeRegion(regionInfo);
Comment thread
wchevreuil marked this conversation as resolved.
FavoredNodesManager fnm = env.getMasterServices().getFavoredNodesManager();
if (fnm != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import java.util.concurrent.ExecutionException;
Comment thread
wchevreuil marked this conversation as resolved.
import java.util.concurrent.ThreadLocalRandom;
import java.util.stream.IntStream;

import org.apache.commons.io.IOUtils;
import org.apache.hadoop.hbase.HBaseClassTestRule;
import org.apache.hadoop.hbase.HBaseTestingUtility;
Expand All @@ -45,16 +46,26 @@
import org.apache.hadoop.hbase.TableNotFoundException;
import org.apache.hadoop.hbase.Waiter.ExplainingPredicate;
import org.apache.hadoop.hbase.client.RegionReplicaTestHelper.Locator;
import org.apache.hadoop.hbase.master.assignment.AssignmentTestingUtil;
import org.apache.hadoop.hbase.master.assignment.SplitTableRegionProcedure;
import org.apache.hadoop.hbase.master.procedure.DeleteTableProcedure;
import org.apache.hadoop.hbase.master.procedure.DisableTableProcedure;
import org.apache.hadoop.hbase.master.procedure.MasterProcedureEnv;
import org.apache.hadoop.hbase.procedure2.ProcedureExecutor;
import org.apache.hadoop.hbase.procedure2.ProcedureTestingUtility;
import org.apache.hadoop.hbase.security.User;
import org.apache.hadoop.hbase.testclassification.ClientTests;
import org.apache.hadoop.hbase.testclassification.MediumTests;
import org.apache.hadoop.hbase.util.Bytes;
import org.apache.hadoop.hbase.util.Threads;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.ClassRule;
import org.junit.Rule;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.junit.rules.TestName;

@Category({ MediumTests.class, ClientTests.class })
public class TestAsyncNonMetaRegionLocator {
Expand All @@ -75,6 +86,9 @@ public class TestAsyncNonMetaRegionLocator {

private static byte[][] SPLIT_KEYS;

@Rule
public TestName name = new TestName();

@BeforeClass
public static void setUp() throws Exception {
TEST_UTIL.startMiniCluster(3);
Expand Down Expand Up @@ -390,6 +404,98 @@ public RegionLocations getRegionLocations(TableName tableName, int replicaId, bo
});
}

@Test
public void testRegionReplicaRitRecovery() throws Exception {
int startRowNum = 11;
int rowCount = 60;

final TableName tableName = TableName.valueOf(name.getMethodName());
final ProcedureExecutor<MasterProcedureEnv> procExec = getMasterProcedureExecutor();
TEST_UTIL.getAdmin().createTable(
TableDescriptorBuilder.newBuilder(tableName)
.setColumnFamily(ColumnFamilyDescriptorBuilder.of(FAMILY)).setRegionReplication(2)
.build());
TEST_UTIL.waitUntilAllRegionsAssigned(tableName);
RegionLocations locs = new Locator() {
Comment thread
wchevreuil marked this conversation as resolved.
Outdated

@Override
public void updateCachedLocationOnError(HRegionLocation loc, Throwable error)
throws Exception {
LOCATOR.updateCachedLocationOnError(loc, error);
}

@Override
public RegionLocations getRegionLocations(TableName tableName, int replicaId, boolean reload)
throws Exception {
return LOCATOR.getRegionLocations(tableName, EMPTY_START_ROW, replicaId,
RegionLocateType.CURRENT, reload).get();
}
}.getRegionLocations(tableName, 0, false);
ServerName serverName =
RegionReplicaTestHelper.getRSCarryingReplica(TEST_UTIL, tableName, 1).get();
List<RegionInfo> regions = TEST_UTIL.getAdmin().getRegions(tableName);
insertData(tableName);
int splitRowNum = startRowNum + rowCount / 2;
byte[] splitKey = Bytes.toBytes("" + splitRowNum);

// Split region of the table
long procId =
procExec.submitProcedure(new SplitTableRegionProcedure(procExec.getEnvironment(), regions
.get(0), splitKey));
// Wait the completion
ProcedureTestingUtility.waitProcedure(procExec, procId);

// Disable the table
long procId1 =
procExec.submitProcedure(new DisableTableProcedure(procExec.getEnvironment(), tableName,
false));
// Wait the completion
ProcedureTestingUtility.waitProcedure(procExec, procId1);

long procId2 =
procExec.submitProcedure(new DeleteTableProcedure(procExec.getEnvironment(), tableName));
// Wait the completion
ProcedureTestingUtility.waitProcedure(procExec, procId2);

AssignmentTestingUtil.killRs(TEST_UTIL, serverName);
long procId3 = getSCPProcId(procExec);
Threads.sleepWithoutInterrupt(5000);

boolean hasRegionsInTransition =
TEST_UTIL.getMiniHBaseCluster().getMaster().getAssignmentManager().getRegionStates()
.hasRegionsInTransition();

assertEquals(false, hasRegionsInTransition);

}

private ProcedureExecutor<MasterProcedureEnv> getMasterProcedureExecutor() {
return TEST_UTIL.getHBaseCluster().getMaster().getMasterProcedureExecutor();
}

private long getSCPProcId(ProcedureExecutor<?> procExec) {
TEST_UTIL.waitFor(35000, () -> !procExec.getProcedures().isEmpty());
return procExec.getActiveProcIds().stream().mapToLong(Long::longValue).min().getAsLong();
}

private void insertData(final TableName tableName) throws IOException, InterruptedException {
Comment thread
wchevreuil marked this conversation as resolved.
Outdated
Table t = TEST_UTIL.getConnection().getTable(tableName);
Put p;
int startRowNum = 11;
int rowCount = 60;
for (int i= 0; i < rowCount / 2; i++) {
p = new Put(Bytes.toBytes("" + (startRowNum + i)));
p.addColumn(Bytes.toBytes("cf"), Bytes.toBytes("q1"), Bytes.toBytes(i));
t.put(p);
p = new Put(Bytes.toBytes("" + (startRowNum + rowCount - i - 1)));
p.addColumn(Bytes.toBytes("cf"), Bytes.toBytes("q1"), Bytes.toBytes(i));
t.put(p);
if (i % 5 == 0) {
TEST_UTIL.getAdmin().flush(tableName);
}
}
}

// Testcase for HBASE-21961
@Test
public void testLocateBeforeInOnlyRegion() throws IOException, InterruptedException {
Expand Down