public class TestIOFencing extends Object
If we happen to assign a region before it fully done with in its old location -- i.e. it is on two servers at the same time -- all can work fine until the case where the region on the dying server decides to compact or otherwise change the region file set. The region in its new location will then get a surprise when it tries to do something w/ a file removed by the region in its old location on dying server.
Making a test for this case is a little tough in that even if a file is deleted up on the namenode, if the file was opened before the delete, it will continue to let reads happen until something changes the state of cached blocks in the dfsclient that was already open (a block from the deleted file is cleaned from the datanode by NN).
What we will do below is do an explicit check for existence on the files listed in the region that has had some files removed because of a compaction. This sort of hurry's along and makes certain what is a chance occurance.
Modifier and Type | Class and Description |
---|---|
static class |
TestIOFencing.BlockCompactionsInCompletionHStore |
static class |
TestIOFencing.BlockCompactionsInCompletionRegion
An override of HRegion that allows us park compactions in a holding pattern and
then when appropriate for the test, allow them proceed again.
|
static class |
TestIOFencing.BlockCompactionsInPrepRegion
An override of HRegion that allows us park compactions in a holding pattern and
then when appropriate for the test, allow them proceed again.
|
static class |
TestIOFencing.CompactionBlockerRegion |
Constructor and Description |
---|
TestIOFencing() |
Modifier and Type | Method and Description |
---|---|
void |
doTest(Class<?> regionClass,
boolean distributedLogReplay) |
void |
testFencingAroundCompaction()
Test that puts up a regionserver, starts a compaction on a loaded region but holds the
compaction until after we have killed the server and the region has come up on
a new regionserver altogether.
|
void |
testFencingAroundCompactionAfterWALSync()
Test that puts up a regionserver, starts a compaction on a loaded region but holds the
compaction completion until after we have killed the server and the region has come up on
a new regionserver altogether.
|
public void testFencingAroundCompaction() throws Exception
Exception
public void testFencingAroundCompactionAfterWALSync() throws Exception
Exception