HBASE-23589: FlushDescriptor contains non-matching family/output combinations (#949)

Signed-off-by: Duo Zhang <zhangduo@apache.org>
Signed-off-by: Lijin Bin <binlijin@apache.org>
This commit is contained in:
BukrosSzabolcs 2019-12-24 12:37:06 +01:00 committed by binlijin
parent 00bb0f20d4
commit ee19008b12
1 changed files with 6 additions and 7 deletions

View File

@ -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<HStore> it = storesToFlush.iterator();
// stores.values() and storeFlushCtxs have same order
for (StoreFlushContext flush : storeFlushCtxs.values()) {
boolean needsCompaction = flush.commit(status);
for (Map.Entry<byte[], StoreFlushContext> flushEntry : storeFlushCtxs.entrySet()) {
StoreFlushContext sfc = flushEntry.getValue();
boolean needsCompaction = sfc.commit(status);
if (needsCompaction) {
compactionRequested = true;
}
byte[] storeName = it.next().getColumnFamilyDescriptor().getName();
List<Path> storeCommittedFiles = flush.getCommittedFiles();
byte[] storeName = flushEntry.getKey();
List<Path> 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();