You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by GitBox <gi...@apache.org> on 2021/01/07 12:07:14 UTC

[GitHub] [hbase] wchevreuil commented on a change in pull request #2844: HBASE-25445: Use WAL FS instead of master FS in SplitWALManager

wchevreuil commented on a change in pull request #2844:
URL: https://github.com/apache/hbase/pull/2844#discussion_r553288289



##########
File path: hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestSplitWALManager.java
##########
@@ -86,6 +98,58 @@ public void teardown() throws Exception {
     TEST_UTIL.shutdownMiniCluster();
   }
 
+  @Test
+  public void testWALArchiveWithDifferentWalAndRootFS() throws Exception{
+    HBaseTestingUtility test_util_2 = new HBaseTestingUtility();
+    Path dir = TEST_UTIL.getDataTestDirOnTestFS("testWalDir");
+    test_util_2.getConfiguration().set(CommonFSUtils.HBASE_WAL_DIR, dir.toString());
+    CommonFSUtils.setWALRootDir(test_util_2.getConfiguration(), dir);
+    test_util_2.startMiniCluster(3);
+    HMaster master2 = test_util_2.getHBaseCluster().getMaster();
+    LOG.info("The Master FS is pointing to: " + master2.getMasterFileSystem()
+      .getFileSystem().getUri());
+    LOG.info("The WAL FS is pointing to: " + master2.getMasterFileSystem()
+      .getWALFileSystem().getUri());
+    Table table = test_util_2.createTable(TABLE_NAME, FAMILY);
+    test_util_2.waitTableAvailable(TABLE_NAME);
+    Admin admin = test_util_2.getAdmin();
+    MasterProcedureEnv env = test_util_2.getMiniHBaseCluster().getMaster()
+      .getMasterProcedureExecutor().getEnvironment();
+    final ProcedureExecutor<MasterProcedureEnv> executor = test_util_2.getMiniHBaseCluster()
+      .getMaster().getMasterProcedureExecutor();
+    List<RegionInfo> regionInfos = admin.getRegions(TABLE_NAME);
+    SplitTableRegionProcedure splitProcedure = new SplitTableRegionProcedure(
+      env, regionInfos.get(0), Bytes.toBytes("row5"));
+    // Populate some rows in the table
+    LOG.info("Beginning put data to the table: " + TABLE_NAME.toString());
+    int rowCount = 5;
+    for (int i = 0; i < rowCount; i++) {
+      byte[] row = Bytes.toBytes("row" + i);
+      Put put = new Put(row);
+      put.addColumn(FAMILY, FAMILY, FAMILY);
+      table.put(put);
+    }
+    executor.submitProcedure(splitProcedure);
+    LOG.info("Submitted SplitProcedure.");
+    test_util_2.waitFor(30000, () -> executor.getProcedures().stream()

Review comment:
       Shouldn't we filter by the split procedure submitted and assert it has completed success?

##########
File path: hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestSplitWALManager.java
##########
@@ -86,6 +98,58 @@ public void teardown() throws Exception {
     TEST_UTIL.shutdownMiniCluster();
   }
 
+  @Test
+  public void testWALArchiveWithDifferentWalAndRootFS() throws Exception{
+    HBaseTestingUtility test_util_2 = new HBaseTestingUtility();

Review comment:
       nit: non static variables should follow camel case style.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org