HBASE-4722 TestGlobalMemStoreSize has started failing; ADDENDUM

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1197349 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Stack 2011-11-03 23:39:48 +00:00
parent ae6af9e630
commit 2ce1d7c97c
2 changed files with 5 additions and 5 deletions

View File

@ -1218,7 +1218,7 @@ public class HRegion implements HeapSize { // , Writable{
status.setStatus("Obtaining lock to block concurrent updates");
this.updatesLock.writeLock().lock();
status.setStatus("Preparing to flush by snapshotting stores");
final long currentMemStoreSize = this.memstoreSize.get();
long currentMemStoreSize = 0;
List<StoreFlusher> storeFlushers = new ArrayList<StoreFlusher>(stores.size());
try {
// Record the rwcc for all transactions in progress.
@ -1279,7 +1279,8 @@ public class HRegion implements HeapSize { // , Writable{
storeFlushers.clear();
// Set down the memstore size by amount of flush.
this.addAndGetGlobalMemstoreSize(-currentMemStoreSize);
currentMemStoreSize =
this.addAndGetGlobalMemstoreSize(-this.memstoreSize.get());
} catch (Throwable t) {
// An exception here means that the snapshot was not persisted.
// The hlog needs to be replayed so its content is restored to memstore.

View File

@ -89,13 +89,12 @@ public class TestGlobalMemStoreSize {
}
// check the global memstore size after flush
LOG.info("Starting flushes");
int i = 0;
for (HRegionServer server : getOnlineRegionServers()) {
LOG.info("Starting flushes on " + server.getServerName() + ", size=" + server.getRegionServerAccounting().getGlobalMemstoreSize());
for (HRegionInfo regionInfo : server.getOnlineRegions()) {
HRegion r = server.getFromOnlineRegions(regionInfo.getEncodedName());
LOG.info("Flushing " + r.toString());
r.flushcache();
LOG.info("Flush " + r.toString() + " on " + server.getServerName() + ", " + r.flushcache() + ", size=" + server.getRegionServerAccounting().getGlobalMemstoreSize());;
}
LOG.info("Post flush on " + server.getServerName());
long now = System.currentTimeMillis();