Class TestIOFencing

java.lang.Object
org.apache.hadoop.hbase.TestIOFencing

public class TestIOFencing extends Object
Test for the case where a regionserver going down has enough cycles to do damage to regions that have actually been assigned elsehwere.

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.

  • Field Details

  • Constructor Details

  • Method Details

    • testFencingAroundCompaction

      public void testFencingAroundCompaction() throws Exception
      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. This fakes the double assignment case where region in one location changes the files out from underneath a region being served elsewhere.
      Throws:
      Exception
    • 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. This fakes the double assignment case where region in one location changes the files out from underneath a region being served elsewhere.
      Throws:
      Exception
    • doTest

      public void doTest(Class<?> regionClass, org.apache.hadoop.hbase.MemoryCompactionPolicy policy) throws Exception
      Throws:
      Exception