HBASE-20775 Addendum disable REGIONS_ON_MASTER for TEstMultiParallel

This commit is contained in:
zhangduo 2018-06-23 17:38:18 +08:00
parent 14087cc919
commit 55147c7eae
1 changed files with 13 additions and 16 deletions

View File

@ -47,7 +47,6 @@ import org.apache.hadoop.hbase.coprocessor.MasterCoprocessor;
import org.apache.hadoop.hbase.coprocessor.MasterCoprocessorEnvironment; import org.apache.hadoop.hbase.coprocessor.MasterCoprocessorEnvironment;
import org.apache.hadoop.hbase.coprocessor.MasterObserver; import org.apache.hadoop.hbase.coprocessor.MasterObserver;
import org.apache.hadoop.hbase.coprocessor.ObserverContext; import org.apache.hadoop.hbase.coprocessor.ObserverContext;
import org.apache.hadoop.hbase.master.LoadBalancer;
import org.apache.hadoop.hbase.master.RegionPlan; import org.apache.hadoop.hbase.master.RegionPlan;
import org.apache.hadoop.hbase.testclassification.FlakeyTests; import org.apache.hadoop.hbase.testclassification.FlakeyTests;
import org.apache.hadoop.hbase.testclassification.MediumTests; import org.apache.hadoop.hbase.testclassification.MediumTests;
@ -85,7 +84,8 @@ public class TestMultiParallel {
private static final int slaves = 5; // also used for testing HTable pool size private static final int slaves = 5; // also used for testing HTable pool size
private static Connection CONNECTION; private static Connection CONNECTION;
@BeforeClass public static void beforeClass() throws Exception { @BeforeClass
public static void beforeClass() throws Exception {
// Uncomment the following lines if more verbosity is needed for // Uncomment the following lines if more verbosity is needed for
// debugging (see HBASE-12285 for details). // debugging (see HBASE-12285 for details).
//((Log4JLogger)RpcServer.LOG).getLogger().setLevel(Level.ALL); //((Log4JLogger)RpcServer.LOG).getLogger().setLevel(Level.ALL);
@ -93,7 +93,8 @@ public class TestMultiParallel {
//((Log4JLogger)ScannerCallable.LOG).getLogger().setLevel(Level.ALL); //((Log4JLogger)ScannerCallable.LOG).getLogger().setLevel(Level.ALL);
UTIL.getConfiguration().set(HConstants.RPC_CODEC_CONF_KEY, UTIL.getConfiguration().set(HConstants.RPC_CODEC_CONF_KEY,
KeyValueCodec.class.getCanonicalName()); KeyValueCodec.class.getCanonicalName());
UTIL.getConfiguration().setBoolean(LoadBalancer.TABLES_ON_MASTER, true); // Disable table on master for now as the feature is broken
//UTIL.getConfiguration().setBoolean(LoadBalancer.TABLES_ON_MASTER, true);
// We used to ask for system tables on Master exclusively but not needed by test and doesn't // We used to ask for system tables on Master exclusively but not needed by test and doesn't
// work anyways -- so commented out. // work anyways -- so commented out.
// UTIL.getConfiguration().setBoolean(LoadBalancer.SYSTEM_TABLES_ON_MASTER, true); // UTIL.getConfiguration().setBoolean(LoadBalancer.SYSTEM_TABLES_ON_MASTER, true);
@ -107,12 +108,14 @@ public class TestMultiParallel {
assertTrue(MyMasterObserver.start.get()); assertTrue(MyMasterObserver.start.get());
} }
@AfterClass public static void afterClass() throws Exception { @AfterClass
public static void afterClass() throws Exception {
CONNECTION.close(); CONNECTION.close();
UTIL.shutdownMiniCluster(); UTIL.shutdownMiniCluster();
} }
@Before public void before() throws Exception { @Before
public void before() throws Exception {
final int balanceCount = MyMasterObserver.postBalanceCount.get(); final int balanceCount = MyMasterObserver.postBalanceCount.get();
LOG.info("before"); LOG.info("before");
if (UTIL.ensureSomeRegionServersAvailable(slaves)) { if (UTIL.ensureSomeRegionServersAvailable(slaves)) {
@ -172,11 +175,8 @@ public class TestMultiParallel {
* This is for testing the active number of threads that were used while * This is for testing the active number of threads that were used while
* doing a batch operation. It inserts one row per region via the batch * doing a batch operation. It inserts one row per region via the batch
* operation, and then checks the number of active threads. * operation, and then checks the number of active threads.
* <p/>
* For HBASE-3553 * For HBASE-3553
* @throws IOException
* @throws InterruptedException
* @throws NoSuchFieldException
* @throws SecurityException
*/ */
@Test @Test
public void testActiveThreadsCount() throws Exception { public void testActiveThreadsCount() throws Exception {
@ -280,8 +280,6 @@ public class TestMultiParallel {
/** /**
* Only run one Multi test with a forced RegionServer abort. Otherwise, the * Only run one Multi test with a forced RegionServer abort. Otherwise, the
* unit tests will take an unnecessarily long time to run. * unit tests will take an unnecessarily long time to run.
*
* @throws Exception
*/ */
@Test @Test
public void testFlushCommitsWithAbort() throws Exception { public void testFlushCommitsWithAbort() throws Exception {
@ -292,7 +290,6 @@ public class TestMultiParallel {
/** /**
* Set table auto flush to false and test flushing commits * Set table auto flush to false and test flushing commits
* @param doAbort true if abort one regionserver in the testing * @param doAbort true if abort one regionserver in the testing
* @throws Exception
*/ */
private void doTestFlushCommits(boolean doAbort) throws Exception { private void doTestFlushCommits(boolean doAbort) throws Exception {
// Load the data // Load the data
@ -342,9 +339,9 @@ public class TestMultiParallel {
UTIL.waitFor(15 * 1000, new Waiter.Predicate<Exception>() { UTIL.waitFor(15 * 1000, new Waiter.Predicate<Exception>() {
@Override @Override
public boolean evaluate() throws Exception { public boolean evaluate() throws Exception {
// Master is also a regionserver, so the count is liveRScount // We disable regions on master so the count should be liveRScount - 1
return UTIL.getMiniHBaseCluster().getMaster() return UTIL.getMiniHBaseCluster().getMaster()
.getClusterMetrics().getLiveServerMetrics().size() == liveRScount; .getClusterMetrics().getLiveServerMetrics().size() == liveRScount - 1;
} }
}); });
UTIL.waitFor(15 * 1000, UTIL.predicateNoRegionsInTransition()); UTIL.waitFor(15 * 1000, UTIL.predicateNoRegionsInTransition());
@ -678,12 +675,12 @@ public class TestMultiParallel {
RowMutations rm = new RowMutations(KEYS[50]); RowMutations rm = new RowMutations(KEYS[50]);
put = new Put(KEYS[50]); put = new Put(KEYS[50]);
put.addColumn(BYTES_FAMILY, qual2, val2); put.addColumn(BYTES_FAMILY, qual2, val2);
rm.add(put); rm.add((Mutation) put);
byte[] qual3 = Bytes.toBytes("qual3"); byte[] qual3 = Bytes.toBytes("qual3");
byte[] val3 = Bytes.toBytes("putvalue3"); byte[] val3 = Bytes.toBytes("putvalue3");
put = new Put(KEYS[50]); put = new Put(KEYS[50]);
put.addColumn(BYTES_FAMILY, qual3, val3); put.addColumn(BYTES_FAMILY, qual3, val3);
rm.add(put); rm.add((Mutation) put);
actions.add(rm); actions.add(rm);
// 7 Add another Get to the mixed sequence after RowMutations // 7 Add another Get to the mixed sequence after RowMutations