Class TestGetLastFlushedSequenceId

java.lang.Object
org.apache.hadoop.hbase.master.TestGetLastFlushedSequenceId

@Tag("org.apache.hadoop.hbase.testclassification.MediumTests") public class TestGetLastFlushedSequenceId extends Object
Trivial test to confirm that we can get last flushed sequence id by encodedRegionName. See HBASE-12715.
  • Field Details

  • Constructor Details

  • Method Details

    • setUp

      @BeforeEach public void setUp() throws Exception
      Throws:
      Exception
    • tearDown

      @AfterEach public void tearDown() throws Exception
      Throws:
      Exception
    • test

      @Test public void test() throws IOException, InterruptedException
      Throws:
      IOException
      InterruptedException
    • testFlushedSequenceIdSeededOnRegionOpen

      HBASE-30335: after a region is opened - and before any user write or flush - the master's flushedSequenceIdByRegion must already contain the region's openSeqNum. Otherwise a subsequent WAL split (e.g. the hosting RS crashes before its first flush heartbeat) would treat already-durable edits as unflushed and produce orphaned recovered.edits.
      Throws:
      IOException
      InterruptedException
    • testFlushedSequenceIdSeededOnRegionClose

      HBASE-30335 follow-up: on graceful region CLOSE the RS reports the region's final durable flushed seqid, and the master must lift its flushedSequenceIdByRegion watermark to that value. This complements the OPEN-time seed and covers the drain-move / disable window: if the source RS crashes after the close, a subsequent WAL split must see the already-durable edits as flushed and not resurrect them as orphaned recovered.edits. Leaves unflushed edits in the memstore so that the close itself flushes and advances the region's maxFlushedSeqId; a heartbeat sent before the close cannot carry that value, so only the CLOSE report can deliver it. Disables the table (a graceful close that keeps the region - unlike delete/split/merge, disable does not call ServerManager#removeRegion) and asserts the watermark equals the post-close flushed seqid.
      Throws:
      IOException
      InterruptedException