Class TestHStore
java.lang.Object
org.apache.hadoop.hbase.regionserver.TestHStore
Test class for the HStore
-
Nested Class Summary
Modifier and TypeClassDescription(package private) static class
static class
(package private) static class
Faulty file system that will fail if you write past its fault position the FIRST TIME only; thereafter it will succeed.(package private) static class
static class
static class
static class
static class
static class
static class
static class
static class
(package private) static class
static class
private static class
(package private) static interface
private static class
private static class
private static class
private static class
-
Field Summary
Modifier and TypeFieldDescriptionprivate static final int
static final HBaseClassTestRule
private static final String
(package private) List<org.apache.hadoop.hbase.Cell>
(package private) byte[]
(package private) org.apache.hadoop.hbase.client.Get
(package private) long
private static final org.slf4j.Logger
org.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 HBaseTestingUtil
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprivate void
private void
archiveStoreFile
(int index) private void
private void
closeCompactedFile
(int index) private long
countMemStoreScanner
(org.apache.hadoop.hbase.regionserver.StoreScanner scanner) private org.apache.hadoop.hbase.ExtendedCell
createCell
(byte[] row, byte[] qualifier, long ts, long sequenceId, byte[] value) private org.apache.hadoop.hbase.ExtendedCell
createCell
(byte[] qualifier, long ts, long sequenceId, byte[] value) private void
doWriteTestLargeCellAndSmallCellConcurrently
(IntBinaryOperator getFlushByteSize) private void
flush
(int storeFilessize) private static org.apache.hadoop.hbase.regionserver.StoreFlushContext
flushStore
(org.apache.hadoop.hbase.regionserver.HStore store, long id) private List<org.apache.hadoop.hbase.ExtendedCell>
getKeyValueSet
(long[] timestamps, int numRows, byte[] qualifier, byte[] family) Generate a list of KeyValues for testing based on given parametersprivate static long
getLowestTimeStampFromFS
(org.apache.hadoop.fs.FileSystem fs, Collection<org.apache.hadoop.hbase.regionserver.HStoreFile> candidates) private <T> T
getTypeKeyValueScanner
(org.apache.hadoop.hbase.regionserver.StoreScanner storeScanner, Class<T> keyValueScannerClass) private void
private org.apache.hadoop.hbase.regionserver.HStore
private org.apache.hadoop.hbase.regionserver.HStore
init
(String methodName, org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.hbase.client.ColumnFamilyDescriptor hcd) 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) 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) 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) 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) private TestHStore.MyStore
initMyStore
(String methodName, org.apache.hadoop.conf.Configuration conf, TestHStore.MyStoreHook hook) private org.apache.hadoop.hbase.regionserver.HStoreFile
mockStoreFile
(long createdTime) private org.apache.hadoop.hbase.regionserver.HStoreFile
mockStoreFileWithLength
(long length) void
setUp()
void
tearDown()
static void
void
testAge()
void
This test is for HBASE-26465, testAbstractMemStore.clearSnapshot(long)
andDefaultMemStore.getScanners(long)
execute concurrently.void
void
void
void
void
Verify that compression and data block encoding are respected by the createWriter method, used on store flush.void
void
testDeleteExpiredStoreFiles
(int minVersions) void
Test for hbase-1686.void
This test is for HBASE-26476void
This test is for HBASE-26384, testCompactingMemStore.flattenOneSegment(long, org.apache.hadoop.hbase.regionserver.MemStoreCompactionStrategy.Action)
andCompactingMemStore.snapshot()
execute concurrently.void
This test is for HBASE-26384, testCompactingMemStore.flattenOneSegment(long, org.apache.hadoop.hbase.regionserver.MemStoreCompactionStrategy.Action)
CompactingMemStore.snapshot()
and writeMemStore execute concurrently.private void
testFlushBeforeCompletingScan
(TestHStore.MyListHook hook, org.apache.hadoop.hbase.filter.Filter filter, int expectedSize) void
void
void
void
Test we do not lose data if we fail a flush and then close.void
This test is for HBASE-27464, before this JIRA,when initCellChunkImmutableSegment
for 'COMPACT' action, we not force copy to current MSLab.void
Getting data from files onlyvoid
Getting data from memstore and filesvoid
Getting data from memstore onlyvoid
void
void
This test is for HBASE-26494, test theRefCnt
behaviors inImmutableMemStoreLAB
void
void
void
void
This test is for HBASE-26488void
Test to ensure correctness when using Stores with multiple timestampsvoid
private void
testNumberOfMemStoreScannersAfterFlush
(List<org.apache.hadoop.hbase.ExtendedCell> inputCellsBeforeSnapshot, List<org.apache.hadoop.hbase.ExtendedCell> inputCellsAfterSnapshot) void
void
void
void
void
If there are two running InMemoryFlushRunnable, the later InMemoryFlushRunnable may change the versionedList.void
void
void
void
Test for HBASE-3492 - Test split on empty colfam (no store files).void
void
void
void
void
This test is for HBASE-27519, when theStoreScanner
is scanning,the Flush and the Compaction execute concurrently and theCcompaction compact and archive the flushedHStoreFile
which 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.updateReaders
would throwFileNotFoundException
.void
void
void
void
private void
testTimeRangeIfSomeCellsAreDroppedInFlush
(int maxVersion) private void
writeAndRead
(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.ExtendedCell> 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.ExtendedCell> inputCellsBeforeSnapshot, List<org.apache.hadoop.hbase.ExtendedCell> inputCellsAfterSnapshot) throws IOException - Throws:
IOException
-
createCell
private org.apache.hadoop.hbase.ExtendedCell createCell(byte[] qualifier, long ts, long sequenceId, byte[] value) throws IOException - Throws:
IOException
-
createCell
private org.apache.hadoop.hbase.ExtendedCell createCell(byte[] row, byte[] qualifier, long ts, long sequenceId, byte[] value) throws IOException - Throws:
IOException
-
testFlushBeforeCompletingScanWoFilter
- Throws:
IOException
InterruptedException
-
testFlushBeforeCompletingScanWithFilter
- Throws:
IOException
InterruptedException
-
testFlushBeforeCompletingScanWithFilterHint
- Throws:
IOException
InterruptedException
-
testFlushBeforeCompletingScan
private void testFlushBeforeCompletingScan(TestHStore.MyListHook hook, org.apache.hadoop.hbase.filter.Filter filter, int expectedSize) throws IOException, InterruptedException - Throws:
IOException
InterruptedException
-
testCreateScannerAndSnapshotConcurrently
- Throws:
IOException
InterruptedException
-
testScanWithDoubleFlush
- Throws:
IOException
-
testStoreScannerUpdateReadersWhenFlushAndCompactConcurrently
This test is for HBASE-27519, when theStoreScanner
is scanning,the Flush and the Compaction execute concurrently and theCcompaction compact and archive the flushedHStoreFile
which 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.updateReaders
would 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:
IOException
InterruptedException
-
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:
IOException
InterruptedException
-
testSpaceQuotaChangeAfterReplacement
- Throws:
IOException
-
testHFileContextSetWithCFAndTable
- Throws:
Exception
-
testCompactingMemStoreNoCellButDataSizeExceedsInmemoryFlushSize
public void testCompactingMemStoreNoCellButDataSizeExceedsInmemoryFlushSize() throws IOException, InterruptedException- Throws:
IOException
InterruptedException
-
testCompactingMemStoreCellExceedInmemoryFlushSize
- Throws:
Exception
-
testForceCloneOfBigCellForCellChunkImmutableSegment
This test is for HBASE-27464, before this JIRA,when initCellChunkImmutableSegment
for '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:
IOException
InterruptedException
-
doWriteTestLargeCellAndSmallCellConcurrently
private void doWriteTestLargeCellAndSmallCellConcurrently(IntBinaryOperator getFlushByteSize) throws IOException, InterruptedException - Throws:
IOException
InterruptedException
-
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. TheCompactingMemStore
size exceedsCompactingMemStore.getInmemoryFlushSize()
,the write thread adds a newImmutableSegment
to 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.version
returned 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.version
is still v. 6. The snapshot thread continuesCompactingMemStore.swapPipelineWithNull(org.apache.hadoop.hbase.regionserver.VersionedSegmentsList)
, and becauseCompactionPipeline.version
is v,CompactingMemStore.swapPipelineWithNull(org.apache.hadoop.hbase.regionserver.VersionedSegmentsList)
thinks it is successful and continue flushing,but theImmutableSegment
inCompactionPipeline
has changed becauseCompactingMemStore.flattenOneSegment(long, org.apache.hadoop.hbase.regionserver.MemStoreCompactionStrategy.Action)
,so theImmutableSegment
is 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.version
to v+1. 6. The snapshot thread continuesCompactingMemStore.swapPipelineWithNull(org.apache.hadoop.hbase.regionserver.VersionedSegmentsList)
, and becauseCompactionPipeline.version
is 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. TheCompactingMemStore
size exceedsCompactingMemStore.getInmemoryFlushSize()
,the write thread adds a newImmutableSegment
to 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.version
returned 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.version
is still v. 6. The snapshot thread continuesCompactingMemStore.swapPipelineWithNull(org.apache.hadoop.hbase.regionserver.VersionedSegmentsList)
, and becauseCompactionPipeline.version
is v,CompactingMemStore.swapPipelineWithNull(org.apache.hadoop.hbase.regionserver.VersionedSegmentsList)
thinks it is successful and continue flushing,but theImmutableSegment
inCompactionPipeline
has changed becauseCompactingMemStore.flattenOneSegment(long, org.apache.hadoop.hbase.regionserver.MemStoreCompactionStrategy.Action)
,so theImmutableSegment
is 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.version
to v+1. 6. The snapshot thread continuesCompactingMemStore.swapPipelineWithNull(org.apache.hadoop.hbase.regionserver.VersionedSegmentsList)
, and becauseCompactionPipeline.version
is v+1,CompactingMemStore.swapPipelineWithNull(org.apache.hadoop.hbase.regionserver.VersionedSegmentsList)
failed and retry,VersionedSegmentsList.version
returned fromCompactingMemStore.getImmutableSegments()
is v+1. 7. The write thread continues writing toCompactingMemStore
andCompactingMemStore
size exceedsCompactingMemStore.getInmemoryFlushSize()
,CompactingMemStore.flushInMemory(MutableSegment)
is called and a newImmutableSegment
is added to the head ofCompactingMemStore.pipeline
,CompactionPipeline.version
is still v+1. 8. The snapshot thread continuesCompactingMemStore.swapPipelineWithNull(org.apache.hadoop.hbase.regionserver.VersionedSegmentsList)
, and becauseCompactionPipeline.version
is still v+1,CompactingMemStore.swapPipelineWithNull(org.apache.hadoop.hbase.regionserver.VersionedSegmentsList)
succeeds.The newImmutableSegment
remained 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 startsDefaultMemStore
flushing after some cells have be added toDefaultMemStore
. 2.The flush thread stopping beforeAbstractMemStore.clearSnapshot(long)
inHStore#updateStorefiles
after 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 correspondingMemStoreLABImpl
is 0, theChunk
s in correspondingMemStoreLABImpl
are recycled. 5.The scan thread continuesDefaultMemStore.getScanners(long)
,and create aSegmentScanner
for thisDefaultMemStore.snapshot()
, and increase the reference count of the correspondingMemStoreLABImpl
, butChunk
s in correspondingMemStoreLABImpl
are recycled by step 4, and theseChunk
s 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 theRefCnt
behaviors inImmutableMemStoreLAB
- Throws:
Exception
-
mockStoreFileWithLength
-