Skip to content

Commit 4b2fe32

Browse files
wchevreuilAmina Dinari
authored andcommitted
CDPD-83261: 2.6 rebase breaks TestHStore in cdh_main (apache#593)
Co-authored-by: Wellington Ramos Chevreuil <wchevreuil@apache.org>
1 parent d2f5ed6 commit 4b2fe32

1 file changed

Lines changed: 3 additions & 10 deletions

File tree

  • hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver

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

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -902,16 +902,9 @@ private boolean completeFlush(List<HStoreFile> sfs, long snapshotId) throws IOEx
902902
// NOTE:we should keep clearSnapshot method inside the write lock because clearSnapshot may
903903
// close {@link DefaultMemStore#snapshot}, which may be used by
904904
// {@link DefaultMemStore#getScanners}.
905-
sfs = storeEngine.addStoreFiles(sfs,() -> {}).stream().collect(Collectors.toList());;
906-
// NOTE: here we must increase the refCount for storeFiles because we would open the
907-
// storeFiles and get the StoreFileScanners for them in HStore.notifyChangedReadersObservers.
908-
// If we don't increase the refCount here, HStore.closeAndArchiveCompactedFiles called by
909-
// CompactedHFilesDischarger may archive the storeFiles after a concurrent compaction.Because
910-
// HStore.requestCompaction is under storeEngine lock, so here we increase the refCount under
911-
// storeEngine lock. see HBASE-27519 for more details.
912-
if (snapshotId > 0) {
913-
this.memstore.clearSnapshot(snapshotId);
914-
}
905+
sfs = storeEngine.addStoreFiles(sfs,(snapshotId > 0) ?
906+
() -> this.memstore.clearSnapshot(snapshotId) :
907+
() -> {}).stream().collect(Collectors.toList());
915908
HStoreFile.increaseStoreFilesRefeCount(sfs);
916909
// notify to be called here - only in case of flushes
917910
try {

0 commit comments

Comments
 (0)