@Test
  public void testSecondaryReplicaReadEnabled() throws Exception {
    tableName = name.getTableName();
    TableDescriptor tableDescriptor = TableDescriptorBuilder.newBuilder(tableName)
      .setRegionReplication(2).setColumnFamily(ColumnFamilyDescriptorBuilder.of(FAMILY))
      .setRegionMemStoreReplication(true).build();
    HTU.getAdmin().createTable(tableDescriptor);

    final ArrayList<Pair<HRegion, HRegionServer>> regionAndRegionServers =
      new ArrayList<Pair<HRegion, HRegionServer>>(Arrays.asList(null, null));

    for (int i = 0; i < 2; i++) {
      HRegionServer rs = HTU.getMiniHBaseCluster().getRegionServer(i);
      List<HRegion> onlineRegions = rs.getRegions(tableName);
      for (HRegion region : onlineRegions) {
        int replicaId = region.getRegionInfo().getReplicaId();
        assertNull(regionAndRegionServers.get(replicaId));
        regionAndRegionServers.set(replicaId, new Pair<HRegion, HRegionServer>(region, rs));
      }
    }
    for (Pair<HRegion, HRegionServer> pair : regionAndRegionServers) {
      assertNotNull(pair);
    }

    HRegionServer secondaryRs = regionAndRegionServers.get(1).getSecond();

    try {
      secondaryRs.getExecutorService()
        .getExecutorThreadPool(ExecutorType.RS_REGION_REPLICA_FLUSH_OPS);
      fail();
    } catch (NullPointerException e) {
      assertTrue(e != null);
    }
    HRegion secondaryRegion = regionAndRegionServers.get(1).getFirst();
    assertFalse(
      ServerRegionReplicaUtil.isRegionReplicaWaitForPrimaryFlushEnabled(secondaryRegion.conf));
    assertTrue(secondaryRegion.isReadsEnabled());
  }
This test is for HBASE-26811,before HBASE-26811,when
{@link ServerRegionReplicaUtil#REGION_REPLICA_WAIT_FOR_PRIMARY_FLUSH_CONF_KEY} is false and set
{@link TableDescriptorBuilder#setRegionMemStoreReplication} to true explicitly,the secondary
replica would be disabled for read after open,after HBASE-26811,the secondary replica would be
enabled for read after open.
hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionReplicaWaitForPrimaryFlushConf.java