HBASE-19065 HRegion#bulkLoadHFiles() should wait for concurrent Region#flush() to finish
Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/3cced094 Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/3cced094 Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/3cced094 Branch: refs/heads/HBASE-18410 Commit: 3cced094c57d7ecaf4f5b22a01cda58294595ced Parents: cda2949 Author: tedyu <yuzhih...@gmail.com> Authored: Tue Oct 24 11:53:21 2017 -0700 Committer: tedyu <yuzhih...@gmail.com> Committed: Tue Oct 24 11:53:21 2017 -0700 ---------------------------------------------------------------------- .../main/java/org/apache/hadoop/hbase/regionserver/HRegion.java | 4 ++++ 1 file changed, 4 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hbase/blob/3cced094/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java ---------------------------------------------------------------------- diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java index e03e4dd..5cbf889 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java @@ -5729,6 +5729,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);