HBASE-19442 Backport HBASE-19065 to branch-1 (HRegion#bulkLoadHFiles() should wait for concurrent Region#flush() to finish).

Signed-off-by: Andrew Purtell <apurtell@apache.org>
This commit is contained in:
Pankaj Kumar 2017-12-07 01:59:20 +08:00 committed by Andrew Purtell
parent 2cab98f6be
commit f88304d162
1 changed files with 4 additions and 0 deletions

View File

@ -5783,6 +5783,10 @@ public class HRegion implements HeapSize, PropagatingConfigurationObserver, Regi
seqId = ((FlushResultImpl)fs).flushSequenceId;
} else if (fs.getResult() == FlushResult.Result.CANNOT_FLUSH_MEMSTORE_EMPTY) {
seqId = ((FlushResultImpl)fs).flushSequenceId;
} else if (fs.getResult() == FlushResult.Result.CANNOT_FLUSH) {
// CANNOT_FLUSH may mean that a flush is already on-going
// we need to wait for that flush to complete
waitForFlushes();
} else {
throw new IOException("Could not bulk load with an assigned sequential ID because the "+
"flush didn't run. Reason for not flushing: " + ((FlushResultImpl)fs).failureReason);