HBASE-19065 HRegion#bulkLoadHFiles() should wait for concurrent Region#flush() to finish

This commit is contained in:
tedyu 2017-11-01 09:26:26 -07:00
parent fc4110a7a9
commit f66afa5227
1 changed files with 4 additions and 0 deletions

View File

@ -5736,6 +5736,10 @@ public class HRegion implements HeapSize, PropagatingConfigurationObserver, Regi
seqId = ((FlushResultImpl)fs).flushSequenceId; seqId = ((FlushResultImpl)fs).flushSequenceId;
} else if (fs.getResult() == FlushResult.Result.CANNOT_FLUSH_MEMSTORE_EMPTY) { } else if (fs.getResult() == FlushResult.Result.CANNOT_FLUSH_MEMSTORE_EMPTY) {
seqId = ((FlushResultImpl)fs).flushSequenceId; 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 { } else {
throw new IOException("Could not bulk load with an assigned sequential ID because the "+ 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); "flush didn't run. Reason for not flushing: " + ((FlushResultImpl)fs).failureReason);