From 0c09c432032a5c9eaf280851668037328142b4a4 Mon Sep 17 00:00:00 2001 From: BukrosSzabolcs Date: Tue, 24 Dec 2019 12:37:06 +0100 Subject: [PATCH] HBASE-23589: FlushDescriptor contains non-matching family/output combinations (#949) Signed-off-by: Duo Zhang Signed-off-by: Lijin Bin --- .../apache/hadoop/hbase/regionserver/HRegion.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) 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 c85fb597188..e7b3b2373f3 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 @@ -2796,22 +2796,21 @@ public class HRegion implements HeapSize, PropagatingConfigurationObserver, Regi // Switch snapshot (in memstore) -> new hfile (thus causing // all the store scanners to reset/reseek). - Iterator it = storesToFlush.iterator(); - // stores.values() and storeFlushCtxs have same order - for (StoreFlushContext flush : storeFlushCtxs.values()) { - boolean needsCompaction = flush.commit(status); + for (Map.Entry flushEntry : storeFlushCtxs.entrySet()) { + StoreFlushContext sfc = flushEntry.getValue(); + boolean needsCompaction = sfc.commit(status); if (needsCompaction) { compactionRequested = true; } - byte[] storeName = it.next().getColumnFamilyDescriptor().getName(); - List storeCommittedFiles = flush.getCommittedFiles(); + byte[] storeName = flushEntry.getKey(); + List storeCommittedFiles = sfc.getCommittedFiles(); committedFiles.put(storeName, storeCommittedFiles); // Flush committed no files, indicating flush is empty or flush was canceled if (storeCommittedFiles == null || storeCommittedFiles.isEmpty()) { MemStoreSize storeFlushableSize = prepareResult.storeFlushableSize.get(storeName); prepareResult.totalFlushableSize.decMemStoreSize(storeFlushableSize); } - flushedOutputFileSize += flush.getOutputFileSize(); + flushedOutputFileSize += sfc.getOutputFileSize(); } storeFlushCtxs.clear();