HBASE-11591 - Addendum based on HBASE-11894
This commit is contained in:
parent
58b5bce172
commit
14fad03045
|
@ -1745,32 +1745,32 @@ public class HRegion implements HeapSize { // , Writable{
|
||||||
this.updatesLock.writeLock().lock();
|
this.updatesLock.writeLock().lock();
|
||||||
try {
|
try {
|
||||||
if (this.memstoreSize.get() <= 0) {
|
if (this.memstoreSize.get() <= 0) {
|
||||||
// Presume that if there are still no edits in the memstore, then there are no edits for
|
// Presume that if there are still no edits in the memstore, then
|
||||||
// this region out in the WAL/HLog subsystem so no need to do any trickery clearing out
|
// there are no edits for
|
||||||
// edits in the WAL system. Up the sequence number so the resulting flush id is for
|
// this region out in the WAL/HLog subsystem so no need to do any
|
||||||
// sure just beyond the last appended region edit (useful as a marker when bulk loading,
|
// trickery clearing out
|
||||||
|
// edits in the WAL system. Up the sequence number so the resulting
|
||||||
|
// flush id is for
|
||||||
|
// sure just beyond the last appended region edit (useful as a marker
|
||||||
|
// when bulk loading,
|
||||||
// etc.)
|
// etc.)
|
||||||
// wal can be null replaying edits.
|
// wal can be null replaying edits.
|
||||||
try {
|
if (wal != null) {
|
||||||
if (wal != null) {
|
w = mvcc.beginMemstoreInsert();
|
||||||
w = mvcc.beginMemstoreInsert();
|
long flushSeqId = getNextSequenceId(wal);
|
||||||
long flushSeqId = getNextSequenceId(wal);
|
FlushResult flushResult = new FlushResult(
|
||||||
FlushResult flushResult = new FlushResult(
|
FlushResult.Result.CANNOT_FLUSH_MEMSTORE_EMPTY, flushSeqId, "Nothing to flush");
|
||||||
FlushResult.Result.CANNOT_FLUSH_MEMSTORE_EMPTY, flushSeqId, "Nothing to flush");
|
w.setWriteNumber(flushSeqId);
|
||||||
w.setWriteNumber(flushSeqId);
|
mvcc.waitForPreviousTransactionsComplete(w);
|
||||||
mvcc.waitForPreviousTransactionsComplete(w);
|
w = null;
|
||||||
w = null;
|
return flushResult;
|
||||||
return flushResult;
|
} else {
|
||||||
} else {
|
return new FlushResult(FlushResult.Result.CANNOT_FLUSH_MEMSTORE_EMPTY,
|
||||||
return new FlushResult(FlushResult.Result.CANNOT_FLUSH_MEMSTORE_EMPTY,
|
"Nothing to flush");
|
||||||
"Nothing to flush");
|
|
||||||
}
|
|
||||||
|
|
||||||
} finally {
|
|
||||||
this.updatesLock.writeLock().unlock();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
|
this.updatesLock.writeLock().unlock();
|
||||||
if (w != null) {
|
if (w != null) {
|
||||||
mvcc.advanceMemstore(w);
|
mvcc.advanceMemstore(w);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue