Skip to content

Commit eb25cdc

Browse files
BukrosSzabolcsbinlijin
authored andcommitted
HBASE-23589: FlushDescriptor contains non-matching family/output combinations (apache#949)
Signed-off-by: Duo Zhang <zhangduo@apache.org> Signed-off-by: Lijin Bin <binlijin@apache.org>
1 parent e18c99f commit eb25cdc

File tree

1 file changed

+6
-7
lines changed
  • hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver

1 file changed

+6
-7
lines changed

hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2796,22 +2796,21 @@ protected FlushResultImpl internalFlushCacheAndCommit(WAL wal, MonitoredTask sta
27962796

27972797
// Switch snapshot (in memstore) -> new hfile (thus causing
27982798
// all the store scanners to reset/reseek).
2799-
Iterator<HStore> it = storesToFlush.iterator();
2800-
// stores.values() and storeFlushCtxs have same order
2801-
for (StoreFlushContext flush : storeFlushCtxs.values()) {
2802-
boolean needsCompaction = flush.commit(status);
2799+
for (Map.Entry<byte[], StoreFlushContext> flushEntry : storeFlushCtxs.entrySet()) {
2800+
StoreFlushContext sfc = flushEntry.getValue();
2801+
boolean needsCompaction = sfc.commit(status);
28032802
if (needsCompaction) {
28042803
compactionRequested = true;
28052804
}
2806-
byte[] storeName = it.next().getColumnFamilyDescriptor().getName();
2807-
List<Path> storeCommittedFiles = flush.getCommittedFiles();
2805+
byte[] storeName = flushEntry.getKey();
2806+
List<Path> storeCommittedFiles = sfc.getCommittedFiles();
28082807
committedFiles.put(storeName, storeCommittedFiles);
28092808
// Flush committed no files, indicating flush is empty or flush was canceled
28102809
if (storeCommittedFiles == null || storeCommittedFiles.isEmpty()) {
28112810
MemStoreSize storeFlushableSize = prepareResult.storeFlushableSize.get(storeName);
28122811
prepareResult.totalFlushableSize.decMemStoreSize(storeFlushableSize);
28132812
}
2814-
flushedOutputFileSize += flush.getOutputFileSize();
2813+
flushedOutputFileSize += sfc.getOutputFileSize();
28152814
}
28162815
storeFlushCtxs.clear();
28172816

0 commit comments

Comments
 (0)