Class TestWALMonotonicallyIncreasingSeqId
java.lang.Object
org.apache.hadoop.hbase.regionserver.TestWALMonotonicallyIncreasingSeqId
Test for HBASE-17471.
MVCCPreAssign is added by HBASE-16698, but pre-assign mvcc is only used in put/delete path. Other write paths like increment/append still assign mvcc in ringbuffer's consumer thread. If put and increment are used parallel. Then seqid in WAL may not increase monotonically Disorder in wals will lead to data loss.
This case use two thread to put and increment at the same time in a single region. Then check the seqid in WAL. If seqid is wal is not monotonically increasing, this case will fail
-
Nested Class Summary
Modifier and TypeClassDescriptionclass
class
-
Field Summary
Modifier and TypeFieldDescriptionstatic final HBaseClassTestRule
private org.apache.hadoop.fs.FileSystem
(package private) CountDownLatch
private final org.slf4j.Logger
org.junit.rules.TestName
private org.apache.hadoop.hbase.regionserver.HRegion
private static final HBaseTestingUtility
private static org.apache.hadoop.fs.Path
private org.apache.hadoop.conf.Configuration
private org.apache.hadoop.hbase.wal.WALFactory
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprivate org.apache.hadoop.hbase.wal.WALStreamReader
createReader
(org.apache.hadoop.fs.Path logPath, org.apache.hadoop.fs.Path oldWalsDir) data()
private org.apache.hadoop.hbase.client.TableDescriptor
getTableDesc
(org.apache.hadoop.hbase.TableName tableName, byte[]... families) private org.apache.hadoop.hbase.regionserver.HRegion
initHRegion
(org.apache.hadoop.hbase.client.TableDescriptor htd, byte[] startKey, byte[] stopKey, int replicaId) void
setUp()
void
tearDown()
static void
void
-
Field Details
-
CLASS_RULE
-
LOG
-
TEST_UTIL
-
testDir
-
wals
-
fileSystem
-
walConf
-
region
-
walProvider
-
name
-
latch
-
-
Constructor Details
-
TestWALMonotonicallyIncreasingSeqId
public TestWALMonotonicallyIncreasingSeqId()
-
-
Method Details
-
data
-
getTableDesc
private org.apache.hadoop.hbase.client.TableDescriptor getTableDesc(org.apache.hadoop.hbase.TableName tableName, byte[]... families) -
initHRegion
private org.apache.hadoop.hbase.regionserver.HRegion initHRegion(org.apache.hadoop.hbase.client.TableDescriptor htd, byte[] startKey, byte[] stopKey, int replicaId) throws IOException - Throws:
IOException
-
setUp
- Throws:
IOException
-
tearDown
- Throws:
IOException
-
tearDownAfterClass
- Throws:
IOException
-
createReader
private org.apache.hadoop.hbase.wal.WALStreamReader createReader(org.apache.hadoop.fs.Path logPath, org.apache.hadoop.fs.Path oldWalsDir) throws IOException - Throws:
IOException
-
testWALMonotonicallyIncreasingSeqId
- Throws:
Exception
-