diff --git src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java index 38bc413..d068a25 100644 --- src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java +++ src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java @@ -1284,8 +1284,8 @@ public class HRegion implements HeapSize { // , Writable{ // rows then) status.setStatus("Obtaining lock to block concurrent updates"); this.updatesLock.writeLock().lock(); + long currentMemStoreSize = this.memstoreSize.get(); status.setStatus("Preparing to flush by snapshotting stores"); - long currentMemStoreSize = 0; List storeFlushers = new ArrayList(stores.size()); try { // Record the mvcc for all transactions in progress. @@ -1307,8 +1307,10 @@ public class HRegion implements HeapSize { // , Writable{ } finally { this.updatesLock.writeLock().unlock(); } - status.setStatus("Waiting for mvcc"); - LOG.debug("Finished snapshotting " + this + ", commencing wait for mvcc"); + String msg = "Finished snapshotting " + this + + ", commencing wait for mvcc, flushsize=" + currentMemStoreSize; + status.setStatus(msg); + LOG.debug(msg); // wait for all in-progress transactions to commit to HLog before // we can start the flush. This prevents @@ -1347,7 +1349,7 @@ public class HRegion implements HeapSize { // , Writable{ // Set down the memstore size by amount of flush. currentMemStoreSize = - this.addAndGetGlobalMemstoreSize(-this.memstoreSize.get()); + this.addAndGetGlobalMemstoreSize(-currentMemStoreSize); } 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. @@ -1385,9 +1387,10 @@ public class HRegion implements HeapSize { // , Writable{ } long time = EnvironmentEdgeManager.currentTimeMillis() - startTime; - String msg = "Finished memstore flush of ~" + - StringUtils.humanReadableInt(currentMemStoreSize) + " for region " + - this + " in " + time + "ms, sequenceid=" + sequenceId + + msg = "Finished memstore flush of ~" + + StringUtils.humanReadableInt(currentMemStoreSize) + "/" + + currentMemStoreSize + " for region " + this + " in " + time + + "ms, sequenceid=" + sequenceId + ", compaction requested=" + compactionRequested + ((wal == null)? "; wal=null": ""); LOG.info(msg); diff --git src/main/java/org/apache/hadoop/hbase/regionserver/wal/HLog.java src/main/java/org/apache/hadoop/hbase/regionserver/wal/HLog.java index 5adb5b3..1823947 100644 --- src/main/java/org/apache/hadoop/hbase/regionserver/wal/HLog.java +++ src/main/java/org/apache/hadoop/hbase/regionserver/wal/HLog.java @@ -1538,11 +1538,6 @@ public class HLog implements Syncable { // Cleaning up of lastSeqWritten is in the finally clause because we // don't want to confuse getOldestOutstandingSeqNum() this.lastSeqWritten.remove(getSnapshotName(encodedRegionName)); - Long l = this.lastSeqWritten.remove(encodedRegionName); - if (l != null) { - LOG.warn("Why is there a raw encodedRegionName in lastSeqWritten? name=" + - Bytes.toString(encodedRegionName) + ", seqid=" + l); - } this.cacheFlushLock.unlock(); } }