HBASE-4722 TestGlobalMemStoreSize has started failing; commit some extra logging to help debug whats going on up on jenkins
git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1196464 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
1b63b76e69
commit
3fab67a8b5
|
@ -32,6 +32,7 @@ import org.apache.hadoop.hbase.regionserver.HRegionServer;
|
||||||
import org.apache.hadoop.hbase.regionserver.HRegion;
|
import org.apache.hadoop.hbase.regionserver.HRegion;
|
||||||
import org.apache.hadoop.hbase.util.Bytes;
|
import org.apache.hadoop.hbase.util.Bytes;
|
||||||
import org.apache.hadoop.hbase.util.JVMClusterUtil;
|
import org.apache.hadoop.hbase.util.JVMClusterUtil;
|
||||||
|
import org.apache.hadoop.hbase.util.Threads;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -40,9 +41,7 @@ import org.junit.Test;
|
||||||
*/
|
*/
|
||||||
public class TestGlobalMemStoreSize {
|
public class TestGlobalMemStoreSize {
|
||||||
private final Log LOG = LogFactory.getLog(this.getClass().getName());
|
private final Log LOG = LogFactory.getLog(this.getClass().getName());
|
||||||
private static final HBaseTestingUtility UTIL = new HBaseTestingUtility();
|
private static int regionServerNum = 4;
|
||||||
|
|
||||||
private static int regionServerNum =4;
|
|
||||||
private static int regionNum = 16;
|
private static int regionNum = 16;
|
||||||
// total region num = region num + root and meta regions
|
// total region num = region num + root and meta regions
|
||||||
private static int totalRegionNum = regionNum+2;
|
private static int totalRegionNum = regionNum+2;
|
||||||
|
@ -80,7 +79,7 @@ public class TestGlobalMemStoreSize {
|
||||||
|
|
||||||
for (HRegionServer server : getOnlineRegionServers()) {
|
for (HRegionServer server : getOnlineRegionServers()) {
|
||||||
long globalMemStoreSize = 0;
|
long globalMemStoreSize = 0;
|
||||||
for(HRegionInfo regionInfo : server.getOnlineRegions()) {
|
for (HRegionInfo regionInfo : server.getOnlineRegions()) {
|
||||||
globalMemStoreSize +=
|
globalMemStoreSize +=
|
||||||
server.getFromOnlineRegions(regionInfo.getEncodedName()).
|
server.getFromOnlineRegions(regionInfo.getEncodedName()).
|
||||||
getMemstoreSize().get();
|
getMemstoreSize().get();
|
||||||
|
@ -90,14 +89,23 @@ public class TestGlobalMemStoreSize {
|
||||||
}
|
}
|
||||||
|
|
||||||
// check the global memstore size after flush
|
// check the global memstore size after flush
|
||||||
|
LOG.info("Starting flushes");
|
||||||
|
int i = 0;
|
||||||
for (HRegionServer server : getOnlineRegionServers()) {
|
for (HRegionServer server : getOnlineRegionServers()) {
|
||||||
for(HRegionInfo regionInfo : server.getOnlineRegions()) {
|
for (HRegionInfo regionInfo : server.getOnlineRegions()) {
|
||||||
HRegion region=
|
HRegion r = server.getFromOnlineRegions(regionInfo.getEncodedName());
|
||||||
server.getFromOnlineRegions(regionInfo.getEncodedName());
|
LOG.info("Flushing " + r.toString());
|
||||||
region.flushcache();
|
r.flushcache();
|
||||||
}
|
}
|
||||||
assertEquals(server.getRegionServerAccounting().getGlobalMemstoreSize(),
|
LOG.info("Post flush on " + server.getServerName());
|
||||||
0);
|
long now = System.currentTimeMillis();
|
||||||
|
long timeout = now + 3000;
|
||||||
|
while(server.getRegionServerAccounting().getGlobalMemstoreSize() != 0 &&
|
||||||
|
timeout < System.currentTimeMillis()) {
|
||||||
|
Threads.sleep(10);
|
||||||
|
}
|
||||||
|
assertEquals("Server=" + server.getServerName() + ", i=" + i++, 0,
|
||||||
|
server.getRegionServerAccounting().getGlobalMemstoreSize());
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_UTIL.shutdownMiniCluster();
|
TEST_UTIL.shutdownMiniCluster();
|
||||||
|
|
Loading…
Reference in New Issue