From ee19008b12d8d52e29f7cb0d8777ab46b36d90cd 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 1e7e537e668..2e2f19bea66 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 @@ -2825,22 +2825,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();