HBASE-1415 Stuck on memcache flush

git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@776903 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Andrew Kyle Purtell 2009-05-21 00:53:21 +00:00
parent 2c502c24fc
commit 1895a6f0c2
2 changed files with 21 additions and 13 deletions

View File

@ -146,6 +146,7 @@ Release 0.20.0 - Unreleased
HBASE-1441 NPE in ProcessRegionStatusChange#getMetaRegion
HBASE-1162 CME in Master in RegionManager.applyActions
HBASE-1010 IOE on regionserver shutdown because hadn't opened an HLog
HBASE-1415 Stuck on memcache flush
IMPROVEMENTS
HBASE-1089 Add count of regions on filesystem to master UI; add percentage

View File

@ -222,27 +222,34 @@ class MemcacheFlusher extends Thread implements FlushRequester {
* not flushed.
*/
private boolean flushRegion(HRegion region, boolean removeFromQueue) {
// Wait until it is safe to flush.
boolean toomany;
do {
toomany = false;
// Wait until it is safe to flush
int count = 0;
boolean triggered = false;
while (count++ < (blockingWaitTime / 500)) {
for (Store hstore: region.stores.values()) {
int files = hstore.getStorefilesCount();
if (files > this.blockingStoreFilesNumber) {
if (LOG.isDebugEnabled()) {
LOG.debug("Too many store files in store " + hstore + ": " +
files + ", waiting");
}
toomany = true;
if (hstore.getStorefilesCount() > this.blockingStoreFilesNumber) {
// always request a compaction
server.compactSplitThread.compactionRequested(region, getName());
// only log once
if (!triggered) {
LOG.info("Too many store files for region " + region + ": " +
hstore.getStorefilesCount() + ", waiting");
triggered = true;
}
try {
Thread.sleep(blockingWaitTime);
Thread.sleep(500);
} catch (InterruptedException e) {
// ignore
}
continue;
}
}
} while (toomany);
if (triggered) {
LOG.info("Compaction completed on region " + region +
", proceeding");
}
break;
}
synchronized (regionsInQueue) {
// See comment above for removeFromQueue on why we do not
// take the region out of the set. If removeFromQueue is true, remove it