apurtell commented on code in PR #6910:
URL: https://github.com/apache/hbase/pull/6910#discussion_r2047755907


##########
hbase-server/src/main/java/org/apache/hadoop/hbase/master/region/MasterRegion.java:
##########
@@ -143,13 +148,23 @@ private void shutdownWAL() {
     }
   }
 
+  @RestrictedApi(explanation = "Should only be called in tests", link = "",
+      allowedOnPath = ".*/src/test/.*")
+  public void setTestFailure() {
+    this.updateFailForTest = true;
+  }
+
   public void update(UpdateMasterRegion action) throws IOException {
     try {
+      if (updateFailForTest) {
+        // test for HBASE-29251
+        throw new IOException("Update failed");
+      }

Review Comment:
   Let's do that and then make this test more clean. 



##########
hbase-server/src/main/java/org/apache/hadoop/hbase/master/region/MasterRegion.java:
##########
@@ -143,13 +148,23 @@ private void shutdownWAL() {
     }
   }
 
+  @RestrictedApi(explanation = "Should only be called in tests", link = "",
+      allowedOnPath = ".*/src/test/.*")
+  public void setTestFailure() {
+    this.updateFailForTest = true;
+  }
+
   public void update(UpdateMasterRegion action) throws IOException {
     try {
+      if (updateFailForTest) {
+        // test for HBASE-29251
+        throw new IOException("Update failed");
+      }
       action.update(region);
       flusherAndCompactor.onUpdate();
-    } catch (WALSyncTimeoutIOException e) {
-      LOG.error(HBaseMarkers.FATAL, "WAL sync timeout. Aborting server.");
-      server.abort("WAL sync timeout", e);
+    } catch (IOException e) {
+      LOG.error(HBaseMarkers.FATAL, "MasterRegion mutation is not successful. 
Aborting server.");
+      server.abort("MasterRegion mutation is not successful", e);

Review Comment:
   Aborting is a start.
   The rest of my question here is addressed by the discussion on the JIRA.



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to