Class TestHStore
java.lang.Object
org.apache.hadoop.hbase.regionserver.TestHStore
Test class for the HStore
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static classstatic class(package private) static classFaulty file system that will fail if you write past its fault position the FIRST TIME only; thereafter it will succeed.(package private) static classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic class(package private) static classstatic classprivate static class(package private) static interfaceprivate static classprivate static classprivate static classprivate static class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final intstatic final HBaseClassTestRuleprivate static final String(package private) List<org.apache.hadoop.hbase.Cell>(package private) byte[](package private) org.apache.hadoop.hbase.client.Get(package private) longprivate static final org.slf4j.Loggerorg.junit.rules.TestName(package private) byte[](package private) byte[](package private) byte[](package private) byte[](package private) byte[](package private) byte[](package private) NavigableSet<byte[]>(package private) org.apache.hadoop.hbase.regionserver.HRegion(package private) List<org.apache.hadoop.hbase.Cell>(package private) byte[](package private) byte[](package private) org.apache.hadoop.hbase.regionserver.HStore(package private) byte[]private static final HBaseTestingUtility -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidprivate voidarchiveStoreFile(int index) private voidprivate voidcloseCompactedFile(int index) private longcountMemStoreScanner(org.apache.hadoop.hbase.regionserver.StoreScanner scanner) private org.apache.hadoop.hbase.CellcreateCell(byte[] row, byte[] qualifier, long ts, long sequenceId, byte[] value) private org.apache.hadoop.hbase.CellcreateCell(byte[] qualifier, long ts, long sequenceId, byte[] value) private voiddoWriteTestLargeCellAndSmallCellConcurrently(IntBinaryOperator getFlushByteSize) private voidflush(int storeFilessize) private static org.apache.hadoop.hbase.regionserver.StoreFlushContextflushStore(org.apache.hadoop.hbase.regionserver.HStore store, long id) private List<org.apache.hadoop.hbase.Cell>getKeyValueSet(long[] timestamps, int numRows, byte[] qualifier, byte[] family) Generate a list of KeyValues for testing based on given parametersprivate static longgetLowestTimeStampFromFS(org.apache.hadoop.fs.FileSystem fs, Collection<org.apache.hadoop.hbase.regionserver.HStoreFile> candidates) private <T> TgetTypeKeyValueScanner(org.apache.hadoop.hbase.regionserver.StoreScanner storeScanner, Class<T> keyValueScannerClass) private voidprivate org.apache.hadoop.hbase.regionserver.HStoreprivate org.apache.hadoop.hbase.regionserver.HStoreinit(String methodName, org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.hbase.client.ColumnFamilyDescriptor hcd) private org.apache.hadoop.hbase.regionserver.HStoreinit(String methodName, org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.hbase.client.TableDescriptorBuilder builder, org.apache.hadoop.hbase.client.ColumnFamilyDescriptor hcd) private org.apache.hadoop.hbase.regionserver.HStoreinit(String methodName, org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.hbase.client.TableDescriptorBuilder builder, org.apache.hadoop.hbase.client.ColumnFamilyDescriptor hcd, TestHStore.MyStoreHook hook) private org.apache.hadoop.hbase.regionserver.HStoreinit(String methodName, org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.hbase.client.TableDescriptorBuilder builder, org.apache.hadoop.hbase.client.ColumnFamilyDescriptor hcd, TestHStore.MyStoreHook hook, boolean switchToPread) private voidinitHRegion(String methodName, org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.hbase.client.TableDescriptorBuilder builder, org.apache.hadoop.hbase.client.ColumnFamilyDescriptor hcd, TestHStore.MyStoreHook hook, boolean switchToPread) private TestHStore.MyStoreinitMyStore(String methodName, org.apache.hadoop.conf.Configuration conf, TestHStore.MyStoreHook hook) private org.apache.hadoop.hbase.regionserver.HStoreFilemockStoreFile(long createdTime) private org.apache.hadoop.hbase.regionserver.HStoreFilemockStoreFileWithLength(long length) voidsetUp()voidtearDown()static voidvoidtestAge()voidThis test is for HBASE-26465, testAbstractMemStore.clearSnapshot(long)andDefaultMemStore.getScanners(long)execute concurrently.voidvoidvoidvoidvoidVerify that compression and data block encoding are respected by the createWriter method, used on store flush.voidvoidtestDeleteExpiredStoreFiles(int minVersions) voidTest for hbase-1686.voidThis test is for HBASE-26476voidThis test is for HBASE-26384, testCompactingMemStore.flattenOneSegment(long, org.apache.hadoop.hbase.regionserver.MemStoreCompactionStrategy.Action)andCompactingMemStore.snapshot()execute concurrently.voidThis test is for HBASE-26384, testCompactingMemStore.flattenOneSegment(long, org.apache.hadoop.hbase.regionserver.MemStoreCompactionStrategy.Action)CompactingMemStore.snapshot()and writeMemStore execute concurrently.private voidtestFlushBeforeCompletingScan(TestHStore.MyListHook hook, org.apache.hadoop.hbase.filter.Filter filter, int expectedSize) voidvoidvoidvoidTest we do not lose data if we fail a flush and then close.voidThis test is for HBASE-27464, before this JIRA,when initCellChunkImmutableSegmentfor 'COMPACT' action, we not force copy to current MSLab.voidGetting data from files onlyvoidGetting data from memstore and filesvoidGetting data from memstore onlyvoidvoidvoidThis test is for HBASE-26494, test theRefCntbehaviors inImmutableMemStoreLABvoidvoidvoidvoidThis test is for HBASE-26488voidTest to ensure correctness when using Stores with multiple timestampsvoidprivate voidtestNumberOfMemStoreScannersAfterFlush(List<org.apache.hadoop.hbase.Cell> inputCellsBeforeSnapshot, List<org.apache.hadoop.hbase.Cell> inputCellsAfterSnapshot) voidvoidvoidvoidvoidIf there are two running InMemoryFlushRunnable, the later InMemoryFlushRunnable may change the versionedList.voidvoidvoidvoidTest for HBASE-3492 - Test split on empty colfam (no store files).voidvoidvoidvoidvoidThis test is for HBASE-27519, when theStoreScanneris scanning,the Flush and the Compaction execute concurrently and theCcompaction compact and archive the flushedHStoreFilewhich is used byStoreScanner.updateReaders(java.util.List<org.apache.hadoop.hbase.regionserver.HStoreFile>, java.util.List<org.apache.hadoop.hbase.regionserver.KeyValueScanner>).Before HBASE-27519,StoreScanner.updateReaderswould throwFileNotFoundException.voidvoidvoidvoidprivate voidtestTimeRangeIfSomeCellsAreDroppedInFlush(int maxVersion) private voidwriteAndRead(org.apache.hadoop.hbase.regionserver.BloomType bloomType, int numStoreFiles)
-
Field Details
-
CLASS_RULE
-
LOG
-
name
-
region
org.apache.hadoop.hbase.regionserver.HRegion region -
store
org.apache.hadoop.hbase.regionserver.HStore store -
table
byte[] table -
family
byte[] family -
row
byte[] row -
row2
byte[] row2 -
qf1
byte[] qf1 -
qf2
byte[] qf2 -
qf3
byte[] qf3 -
qf4
byte[] qf4 -
qf5
byte[] qf5 -
qf6
byte[] qf6 -
qualifiers
NavigableSet<byte[]> qualifiers -
expected
-
result
-
id
long id -
get
org.apache.hadoop.hbase.client.Get get -
TEST_UTIL
-
DIR
-
BLOCKSIZE_SMALL
- See Also:
-
-
Constructor Details
-
TestHStore
public TestHStore()
-
-
Method Details
-
setUp
- Throws:
IOException
-
init
- Throws:
IOException
-
init
private org.apache.hadoop.hbase.regionserver.HStore init(String methodName, org.apache.hadoop.conf.Configuration conf) throws IOException - Throws:
IOException
-
init
private org.apache.hadoop.hbase.regionserver.HStore init(String methodName, org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.hbase.client.ColumnFamilyDescriptor hcd) throws IOException - Throws:
IOException
-
init
private org.apache.hadoop.hbase.regionserver.HStore init(String methodName, org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.hbase.client.TableDescriptorBuilder builder, org.apache.hadoop.hbase.client.ColumnFamilyDescriptor hcd) throws IOException - Throws:
IOException
-
init
private org.apache.hadoop.hbase.regionserver.HStore init(String methodName, org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.hbase.client.TableDescriptorBuilder builder, org.apache.hadoop.hbase.client.ColumnFamilyDescriptor hcd, TestHStore.MyStoreHook hook) throws IOException - Throws:
IOException
-
initHRegion
private void initHRegion(String methodName, org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.hbase.client.TableDescriptorBuilder builder, org.apache.hadoop.hbase.client.ColumnFamilyDescriptor hcd, TestHStore.MyStoreHook hook, boolean switchToPread) throws IOException - Throws:
IOException
-
init
private org.apache.hadoop.hbase.regionserver.HStore init(String methodName, org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.hbase.client.TableDescriptorBuilder builder, org.apache.hadoop.hbase.client.ColumnFamilyDescriptor hcd, TestHStore.MyStoreHook hook, boolean switchToPread) throws IOException - Throws:
IOException
-
testFlushSizeSizing
Test we do not lose data if we fail a flush and then close. Part of HBase-10466- Throws:
Exception
-
testStoreBloomFilterMetricsWithBloomRowCol
- Throws:
IOException
-
testStoreBloomFilterMetricsWithBloomRow
- Throws:
IOException
-
testStoreBloomFilterMetricsWithBloomRowPrefix
- Throws:
IOException
-
testStoreBloomFilterMetricsWithBloomNone
- Throws:
IOException
-
writeAndRead
private void writeAndRead(org.apache.hadoop.hbase.regionserver.BloomType bloomType, int numStoreFiles) throws IOException - Throws:
IOException
-
testCreateWriter
Verify that compression and data block encoding are respected by the createWriter method, used on store flush.- Throws:
Exception
-
testDeleteExpiredStoreFiles
- Throws:
Exception
-
testDeleteExpiredStoreFiles
- Parameters:
minVersions- the MIN_VERSIONS for the column family- Throws:
Exception
-
testLowestModificationTime
- Throws:
Exception
-
getLowestTimeStampFromFS
private static long getLowestTimeStampFromFS(org.apache.hadoop.fs.FileSystem fs, Collection<org.apache.hadoop.hbase.regionserver.HStoreFile> candidates) throws IOException - Throws:
IOException
-
testEmptyStoreFile
Test for hbase-1686.- Throws:
IOException
-
testGet_FromMemStoreOnly
Getting data from memstore only- Throws:
IOException
-
testTimeRangeIfSomeCellsAreDroppedInFlush
- Throws:
IOException
-
testTimeRangeIfSomeCellsAreDroppedInFlush
- Throws:
IOException
-
testGet_FromFilesOnly
Getting data from files only- Throws:
IOException
-
testGet_FromMemStoreAndFiles
Getting data from memstore and files- Throws:
IOException
-
flush
- Throws:
IOException
-
assertCheck
-
tearDown
- Throws:
Exception
-
tearDownAfterClass
- Throws:
IOException
-
testHandleErrorsInFlush
- Throws:
Exception
-
flushStore
private static org.apache.hadoop.hbase.regionserver.StoreFlushContext flushStore(org.apache.hadoop.hbase.regionserver.HStore store, long id) throws IOException - Throws:
IOException
-
getKeyValueSet
private List<org.apache.hadoop.hbase.Cell> getKeyValueSet(long[] timestamps, int numRows, byte[] qualifier, byte[] family) Generate a list of KeyValues for testing based on given parameters- Returns:
- the rows key-value list
-
testMultipleTimestamps
Test to ensure correctness when using Stores with multiple timestamps- Throws:
IOException
-
testSplitWithEmptyColFam
Test for HBASE-3492 - Test split on empty colfam (no store files).- Throws:
IOException- When the IO operations fail.
-
testStoreUsesConfigurationFromHcdAndHtd
- Throws:
Exception
-
testStoreUsesSearchEngineOverride
- Throws:
Exception
-
addStoreFile
- Throws:
IOException
-
archiveStoreFile
- Throws:
IOException
-
closeCompactedFile
- Throws:
IOException
-
testRefreshStoreFiles
- Throws:
Exception
-
testRefreshStoreFilesNotChanged
- Throws:
IOException
-
testScanWithCompactionAfterFlush
- Throws:
Exception
-
countMemStoreScanner
-
testNumberOfMemStoreScannersAfterFlush
- Throws:
IOException
-
testNumberOfMemStoreScannersAfterFlush
private void testNumberOfMemStoreScannersAfterFlush(List<org.apache.hadoop.hbase.Cell> inputCellsBeforeSnapshot, List<org.apache.hadoop.hbase.Cell> inputCellsAfterSnapshot) throws IOException - Throws:
IOException
-
createCell
private org.apache.hadoop.hbase.Cell createCell(byte[] qualifier, long ts, long sequenceId, byte[] value) throws IOException - Throws:
IOException
-
createCell
private org.apache.hadoop.hbase.Cell createCell(byte[] row, byte[] qualifier, long ts, long sequenceId, byte[] value) throws IOException - Throws:
IOException
-
testFlushBeforeCompletingScanWoFilter
- Throws:
IOExceptionInterruptedException
-
testFlushBeforeCompletingScanWithFilter
- Throws:
IOExceptionInterruptedException
-
testFlushBeforeCompletingScanWithFilterHint
- Throws:
IOExceptionInterruptedException
-
testFlushBeforeCompletingScan
private void testFlushBeforeCompletingScan(TestHStore.MyListHook hook, org.apache.hadoop.hbase.filter.Filter filter, int expectedSize) throws IOException, InterruptedException - Throws:
IOExceptionInterruptedException
-
testCreateScannerAndSnapshotConcurrently
- Throws:
IOExceptionInterruptedException
-
testScanWithDoubleFlush
- Throws:
IOException
-
testStoreScannerUpdateReadersWhenFlushAndCompactConcurrently
This test is for HBASE-27519, when theStoreScanneris scanning,the Flush and the Compaction execute concurrently and theCcompaction compact and archive the flushedHStoreFilewhich is used byStoreScanner.updateReaders(java.util.List<org.apache.hadoop.hbase.regionserver.HStoreFile>, java.util.List<org.apache.hadoop.hbase.regionserver.KeyValueScanner>).Before HBASE-27519,StoreScanner.updateReaderswould throwFileNotFoundException.- Throws:
IOException
-
testReclaimChunkWhenScaning
- Throws:
IOException
-
testRunDoubleMemStoreCompactors
If there are two running InMemoryFlushRunnable, the later InMemoryFlushRunnable may change the versionedList. And the first InMemoryFlushRunnable will use the chagned versionedList to remove the corresponding segments. In short, there will be some segements which isn't in merge are removed.- Throws:
IOExceptionInterruptedException
-
testAge
- Throws:
IOException
-
mockStoreFile
-
initMyStore
private TestHStore.MyStore initMyStore(String methodName, org.apache.hadoop.conf.Configuration conf, TestHStore.MyStoreHook hook) throws IOException - Throws:
IOException
-
testSwitchingPreadtoStreamParallelyWithCompactionDischarger
- Throws:
Exception
-
testMaxPreadBytesConfiguredToBeLessThanZero
- Throws:
Exception
-
testInMemoryCompactionTypeWithLowerCase
- Throws:
IOExceptionInterruptedException
-
testSpaceQuotaChangeAfterReplacement
- Throws:
IOException
-
testHFileContextSetWithCFAndTable
- Throws:
Exception
-
testCompactingMemStoreNoCellButDataSizeExceedsInmemoryFlushSize
public void testCompactingMemStoreNoCellButDataSizeExceedsInmemoryFlushSize() throws IOException, InterruptedException- Throws:
IOExceptionInterruptedException
-
testCompactingMemStoreCellExceedInmemoryFlushSize
- Throws:
Exception
-
testForceCloneOfBigCellForCellChunkImmutableSegment
This test is for HBASE-27464, before this JIRA,when initCellChunkImmutableSegmentfor 'COMPACT' action, we not force copy to current MSLab. When cell size bigger thanMemStoreLABImpl.maxAlloc, cell will stay in previous chunk which will recycle after segment replace, and we may read wrong data when these chunk reused by others.- Throws:
Exception
-
testCompactingMemStoreWriteLargeCellAndSmallCellConcurrently
public void testCompactingMemStoreWriteLargeCellAndSmallCellConcurrently() throws IOException, InterruptedException- Throws:
IOExceptionInterruptedException
-
doWriteTestLargeCellAndSmallCellConcurrently
private void doWriteTestLargeCellAndSmallCellConcurrently(IntBinaryOperator getFlushByteSize) throws IOException, InterruptedException - Throws:
IOExceptionInterruptedException
-
testFlattenAndSnapshotCompactingMemStoreConcurrently
This test is for HBASE-26384, test
CompactingMemStore.flattenOneSegment(long, org.apache.hadoop.hbase.regionserver.MemStoreCompactionStrategy.Action)andCompactingMemStore.snapshot()execute concurrently. The threads sequence before HBASE-26384 is(The bug only exists for branch-2,and I add UTs for both branch-2 and master): 1. TheCompactingMemStoresize exceedsCompactingMemStore.getInmemoryFlushSize(),the write thread adds a newImmutableSegmentto the head ofCompactingMemStore.pipeline,and start a in memory compact thread to executeCompactingMemStore.inMemoryCompaction(). 2. The in memory compact thread starts and then stopping beforeCompactingMemStore.flattenOneSegment(long, org.apache.hadoop.hbase.regionserver.MemStoreCompactionStrategy.Action). 3. The snapshot thread startsCompactingMemStore.snapshot()concurrently,after the snapshot thread executingCompactingMemStore.getImmutableSegments(),the in memory compact thread continues. AssumingVersionedSegmentsList.versionreturned fromCompactingMemStore.getImmutableSegments()is v. 4. The snapshot thread stopping beforeCompactingMemStore.swapPipelineWithNull(org.apache.hadoop.hbase.regionserver.VersionedSegmentsList). 5. The in memory compact thread completesCompactingMemStore.flattenOneSegment(long, org.apache.hadoop.hbase.regionserver.MemStoreCompactionStrategy.Action),CompactionPipeline.versionis still v. 6. The snapshot thread continuesCompactingMemStore.swapPipelineWithNull(org.apache.hadoop.hbase.regionserver.VersionedSegmentsList), and becauseCompactionPipeline.versionis v,CompactingMemStore.swapPipelineWithNull(org.apache.hadoop.hbase.regionserver.VersionedSegmentsList)thinks it is successful and continue flushing,but theImmutableSegmentinCompactionPipelinehas changed becauseCompactingMemStore.flattenOneSegment(long, org.apache.hadoop.hbase.regionserver.MemStoreCompactionStrategy.Action),so theImmutableSegmentis not removed in fact and still remaining inCompactionPipeline. After HBASE-26384, the 5-6 step is changed to following, which is expected behavior: 5. The in memory compact thread completesCompactingMemStore.flattenOneSegment(long, org.apache.hadoop.hbase.regionserver.MemStoreCompactionStrategy.Action),CompactingMemStore.flattenOneSegment(long, org.apache.hadoop.hbase.regionserver.MemStoreCompactionStrategy.Action)changeCompactionPipeline.versionto v+1. 6. The snapshot thread continuesCompactingMemStore.swapPipelineWithNull(org.apache.hadoop.hbase.regionserver.VersionedSegmentsList), and becauseCompactionPipeline.versionis v+1,CompactingMemStore.swapPipelineWithNull(org.apache.hadoop.hbase.regionserver.VersionedSegmentsList)failed and retry the while loop inCompactingMemStore.pushPipelineToSnapshot()once again, because there is no concurrentCompactingMemStore.inMemoryCompaction()now,CompactingMemStore.swapPipelineWithNull(org.apache.hadoop.hbase.regionserver.VersionedSegmentsList)succeeds.- Throws:
Exception
-
testFlattenSnapshotWriteCompactingMemeStoreConcurrently
This test is for HBASE-26384, test
CompactingMemStore.flattenOneSegment(long, org.apache.hadoop.hbase.regionserver.MemStoreCompactionStrategy.Action)CompactingMemStore.snapshot()and writeMemStore execute concurrently. The threads sequence before HBASE-26384 is(The bug only exists for branch-2,and I add UTs for both branch-2 and master): 1. TheCompactingMemStoresize exceedsCompactingMemStore.getInmemoryFlushSize(),the write thread adds a newImmutableSegmentto the head ofCompactingMemStore.pipeline,and start a in memory compact thread to executeCompactingMemStore.inMemoryCompaction(). 2. The in memory compact thread starts and then stopping beforeCompactingMemStore.flattenOneSegment(long, org.apache.hadoop.hbase.regionserver.MemStoreCompactionStrategy.Action). 3. The snapshot thread startsCompactingMemStore.snapshot()concurrently,after the snapshot thread executingCompactingMemStore.getImmutableSegments(),the in memory compact thread continues. AssumingVersionedSegmentsList.versionreturned fromCompactingMemStore.getImmutableSegments()is v. 4. The snapshot thread stopping beforeCompactingMemStore.swapPipelineWithNull(org.apache.hadoop.hbase.regionserver.VersionedSegmentsList). 5. The in memory compact thread completesCompactingMemStore.flattenOneSegment(long, org.apache.hadoop.hbase.regionserver.MemStoreCompactionStrategy.Action),CompactionPipeline.versionis still v. 6. The snapshot thread continuesCompactingMemStore.swapPipelineWithNull(org.apache.hadoop.hbase.regionserver.VersionedSegmentsList), and becauseCompactionPipeline.versionis v,CompactingMemStore.swapPipelineWithNull(org.apache.hadoop.hbase.regionserver.VersionedSegmentsList)thinks it is successful and continue flushing,but theImmutableSegmentinCompactionPipelinehas changed becauseCompactingMemStore.flattenOneSegment(long, org.apache.hadoop.hbase.regionserver.MemStoreCompactionStrategy.Action),so theImmutableSegmentis not removed in fact and still remaining inCompactionPipeline. After HBASE-26384, the 5-6 step is changed to following, which is expected behavior, and I add step 7-8 to test there is new segment added before retry. 5. The in memory compact thread completesCompactingMemStore.flattenOneSegment(long, org.apache.hadoop.hbase.regionserver.MemStoreCompactionStrategy.Action),CompactingMemStore.flattenOneSegment(long, org.apache.hadoop.hbase.regionserver.MemStoreCompactionStrategy.Action)changeCompactionPipeline.versionto v+1. 6. The snapshot thread continuesCompactingMemStore.swapPipelineWithNull(org.apache.hadoop.hbase.regionserver.VersionedSegmentsList), and becauseCompactionPipeline.versionis v+1,CompactingMemStore.swapPipelineWithNull(org.apache.hadoop.hbase.regionserver.VersionedSegmentsList)failed and retry,VersionedSegmentsList.versionreturned fromCompactingMemStore.getImmutableSegments()is v+1. 7. The write thread continues writing toCompactingMemStoreandCompactingMemStoresize exceedsCompactingMemStore.getInmemoryFlushSize(),CompactingMemStore.flushInMemory(MutableSegment)is called and a newImmutableSegmentis added to the head ofCompactingMemStore.pipeline,CompactionPipeline.versionis still v+1. 8. The snapshot thread continuesCompactingMemStore.swapPipelineWithNull(org.apache.hadoop.hbase.regionserver.VersionedSegmentsList), and becauseCompactionPipeline.versionis still v+1,CompactingMemStore.swapPipelineWithNull(org.apache.hadoop.hbase.regionserver.VersionedSegmentsList)succeeds.The newImmutableSegmentremained at the head ofCompactingMemStore.pipeline,the old is removed byCompactingMemStore.swapPipelineWithNull(org.apache.hadoop.hbase.regionserver.VersionedSegmentsList).- Throws:
Exception
-
testClearSnapshotGetScannerConcurrently
This test is for HBASE-26465, test
AbstractMemStore.clearSnapshot(long)andDefaultMemStore.getScanners(long)execute concurrently. The threads sequence before HBASE-26465 is: 1.The flush thread startsDefaultMemStoreflushing after some cells have be added toDefaultMemStore. 2.The flush thread stopping beforeAbstractMemStore.clearSnapshot(long)inHStore#updateStorefilesafter completed flushing memStore to hfile. 3.The scan thread starts and stopping afterDefaultMemStore.getSnapshotSegments()inDefaultMemStore.getScanners(long),here the scan thread gets theDefaultMemStore.snapshot()which is created by the flush thread. 4.The flush thread continuesAbstractMemStore.clearSnapshot(long)and closeDefaultMemStore.snapshot(),because the reference count of the correspondingMemStoreLABImplis 0, theChunks in correspondingMemStoreLABImplare recycled. 5.The scan thread continuesDefaultMemStore.getScanners(long),and create aSegmentScannerfor thisDefaultMemStore.snapshot(), and increase the reference count of the correspondingMemStoreLABImpl, butChunks in correspondingMemStoreLABImplare recycled by step 4, and theseChunks may be overwritten by other write threads,which may cause serious problem. After HBASE-26465,DefaultMemStore.getScanners(long)andAbstractMemStore.clearSnapshot(long)could not execute concurrently.- Throws:
Exception
-
getTypeKeyValueScanner
private <T> T getTypeKeyValueScanner(org.apache.hadoop.hbase.regionserver.StoreScanner storeScanner, Class<T> keyValueScannerClass) -
testOnConfigurationChange
- Throws:
IOException
-
testExtendsDefaultMemStore
This test is for HBASE-26476- Throws:
Exception
-
testMemoryLeakWhenFlushMemStoreRetrying
This test is for HBASE-26488- Throws:
Exception
-
testImmutableMemStoreLABRefCnt
This test is for HBASE-26494, test theRefCntbehaviors inImmutableMemStoreLAB- Throws:
Exception
-
mockStoreFileWithLength
-