public class TestWALMonotonicallyIncreasingSeqId extends Object
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
Modifier and Type | Class and Description |
---|---|
class |
TestWALMonotonicallyIncreasingSeqId.IncThread |
class |
TestWALMonotonicallyIncreasingSeqId.PutThread |
Modifier and Type | Field and Description |
---|---|
static HBaseClassTestRule |
CLASS_RULE |
private org.apache.hadoop.fs.FileSystem |
fileSystem |
(package private) CountDownLatch |
latch |
private org.slf4j.Logger |
LOG |
org.junit.rules.TestName |
name |
private org.apache.hadoop.hbase.regionserver.HRegion |
region |
private static HBaseTestingUtility |
TEST_UTIL |
private static org.apache.hadoop.fs.Path |
testDir |
private org.apache.hadoop.conf.Configuration |
walConf |
String |
walProvider |
private org.apache.hadoop.hbase.wal.WALFactory |
wals |
Constructor and Description |
---|
TestWALMonotonicallyIncreasingSeqId() |
Modifier and Type | Method and Description |
---|---|
private org.apache.hadoop.hbase.wal.WAL.Reader |
createReader(org.apache.hadoop.fs.Path logPath,
org.apache.hadoop.fs.Path oldWalsDir) |
static List<Object[]> |
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 |
tearDownAfterClass() |
void |
testWALMonotonicallyIncreasingSeqId() |
public static final HBaseClassTestRule CLASS_RULE
private final org.slf4j.Logger LOG
private static final HBaseTestingUtility TEST_UTIL
private static org.apache.hadoop.fs.Path testDir
private org.apache.hadoop.hbase.wal.WALFactory wals
private org.apache.hadoop.fs.FileSystem fileSystem
private org.apache.hadoop.conf.Configuration walConf
private org.apache.hadoop.hbase.regionserver.HRegion region
public String walProvider
public org.junit.rules.TestName name
CountDownLatch latch
public TestWALMonotonicallyIncreasingSeqId()
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) throws IOException
IOException
public void setUp() throws IOException
IOException
public void tearDown() throws IOException
IOException
public static void tearDownAfterClass() throws IOException
IOException
private org.apache.hadoop.hbase.wal.WAL.Reader createReader(org.apache.hadoop.fs.Path logPath, org.apache.hadoop.fs.Path oldWalsDir) throws IOException
IOException
public void testWALMonotonicallyIncreasingSeqId() throws Exception
Exception
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.