Class TestRegionReplicaFailover

java.lang.Object
org.apache.hadoop.hbase.regionserver.TestRegionReplicaFailover

@Tag("org.apache.hadoop.hbase.testclassification.LargeTests") public class TestRegionReplicaFailover extends Object
Tests failover of secondary region replicas.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final byte[]
     
    protected final byte[][]
     
    private org.apache.hadoop.hbase.client.TableDescriptor
     
    private static final HBaseTestingUtil
     
    private static final org.slf4j.Logger
     
    private static final int
     
    protected final byte[]
     
    protected final byte[]
     
    protected final byte[]
     
    protected final byte[]
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    void
    before(org.junit.jupiter.api.TestInfo testInfo)
     
    void
    Tests the case where we are creating a table with a lot of regions and replicas.
    void
    Tests the case where killing a primary region with unflushed data recovers
    void
    Tests the case where killing a secondary region with unflushed data recovers, and the replica becomes available to read again shortly.
    void
    Tests the case where there are 3 region replicas and the primary is continuously accepting new writes while one of the secondaries is killed.
    void
    Tests the case where a newly created table with region replicas and no data, the secondary region replicas are available to read immediately.
    void
    Tests the case where if there is some data in the primary region, reopening the region replicas (enable/disable table, etc) makes the region replicas readable.
    private void
    verifyNumericRowsWithTimeout(org.apache.hadoop.hbase.client.Table table, byte[] f, int startRow, int endRow, int replicaId, long timeout)
    wal replication is async, we have to wait until the replication catches up, or we timeout

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • LOG

      private static final org.slf4j.Logger LOG
    • HTU

      private static final HBaseTestingUtil HTU
    • NB_SERVERS

      private static final int NB_SERVERS
      See Also:
    • families

      protected final byte[][] families
    • fam

      protected final byte[] fam
    • qual1

      protected final byte[] qual1
    • value1

      protected final byte[] value1
    • row

      protected final byte[] row
    • row2

      protected final byte[] row2
    • htd

      private org.apache.hadoop.hbase.client.TableDescriptor htd
  • Constructor Details

  • Method Details

    • before

      @BeforeEach public void before(org.junit.jupiter.api.TestInfo testInfo) throws Exception
      Throws:
      Exception
    • after

      @AfterEach public void after() throws Exception
      Throws:
      Exception
    • testSecondaryRegionWithEmptyRegion

      @Test public void testSecondaryRegionWithEmptyRegion() throws IOException
      Tests the case where a newly created table with region replicas and no data, the secondary region replicas are available to read immediately.
      Throws:
      IOException
    • testSecondaryRegionWithNonEmptyRegion

      Tests the case where if there is some data in the primary region, reopening the region replicas (enable/disable table, etc) makes the region replicas readable.
      Throws:
      IOException
    • testPrimaryRegionKill

      @Test public void testPrimaryRegionKill() throws Exception
      Tests the case where killing a primary region with unflushed data recovers
      Throws:
      Exception
    • verifyNumericRowsWithTimeout

      private void verifyNumericRowsWithTimeout(org.apache.hadoop.hbase.client.Table table, byte[] f, int startRow, int endRow, int replicaId, long timeout) throws Exception
      wal replication is async, we have to wait until the replication catches up, or we timeout
      Throws:
      Exception
    • testSecondaryRegionKill

      @Test public void testSecondaryRegionKill() throws Exception
      Tests the case where killing a secondary region with unflushed data recovers, and the replica becomes available to read again shortly.
      Throws:
      Exception
    • testSecondaryRegionKillWhilePrimaryIsAcceptingWrites

      Tests the case where there are 3 region replicas and the primary is continuously accepting new writes while one of the secondaries is killed. Verification is done for both of the secondary replicas.
      Throws:
      Exception
    • testLotsOfRegionReplicas

      @Test public void testLotsOfRegionReplicas() throws IOException
      Tests the case where we are creating a table with a lot of regions and replicas. Opening region replicas should not block handlers on RS indefinitely.
      Throws:
      IOException