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


##########
hbase-server/src/main/java/org/apache/hadoop/hbase/master/region/MasterRegion.java:
##########
@@ -143,17 +154,54 @@ private void shutdownWAL() {
     }
   }
 
+  /**
+   * Performs the mutation to the master region using UpdateMasterRegion 
update action.
+   * @param action Update region action.
+   * @throws IOException IO error that causes active master to abort.
+   */
   public void update(UpdateMasterRegion action) throws IOException {
-    try {
-      action.update(region);
-      flusherAndCompactor.onUpdate();
-    } catch (WALSyncTimeoutIOException e) {
-      LOG.error(HBaseMarkers.FATAL, "WAL sync timeout. Aborting server.");
-      server.abort("WAL sync timeout", e);
-      throw e;
+    for (int tries = 0; tries < maxRetriesForRegionUpdates; tries++) {
+      try {
+        // If the update is successful, return immediately.
+        action.update(region);
+        flusherAndCompactor.onUpdate();
+        return;
+      } catch (RegionTooBusyException e) {
+        // RegionTooBusyException is the type of IOException for which we can 
retry
+        // for few times before aborting the active master. The master region 
might
+        // have genuine case for delayed flushes and/or some procedure bug 
causing
+        // heavy pressure on the memstore.
+        if (tries == (maxRetriesForRegionUpdates - 1)) {

Review Comment:
   If `RegionTooBusyException` is caught, here can trigger 
`flusherAndCompactor.onUpdate();`.



##########
hbase-server/src/main/java/org/apache/hadoop/hbase/master/region/MasterRegion.java:
##########
@@ -143,17 +154,54 @@ private void shutdownWAL() {
     }
   }
 
+  /**
+   * Performs the mutation to the master region using UpdateMasterRegion 
update action.
+   * @param action Update region action.
+   * @throws IOException IO error that causes active master to abort.
+   */
   public void update(UpdateMasterRegion action) throws IOException {
-    try {
-      action.update(region);
-      flusherAndCompactor.onUpdate();
-    } catch (WALSyncTimeoutIOException e) {
-      LOG.error(HBaseMarkers.FATAL, "WAL sync timeout. Aborting server.");
-      server.abort("WAL sync timeout", e);
-      throw e;
+    for (int tries = 0; tries < maxRetriesForRegionUpdates; tries++) {
+      try {
+        // If the update is successful, return immediately.
+        action.update(region);
+        flusherAndCompactor.onUpdate();
+        return;
+      } catch (RegionTooBusyException e) {
+        // RegionTooBusyException is the type of IOException for which we can 
retry
+        // for few times before aborting the active master. The master region 
might
+        // have genuine case for delayed flushes and/or some procedure bug 
causing
+        // heavy pressure on the memstore.
+        if (tries == (maxRetriesForRegionUpdates - 1)) {

Review Comment:
   If `RegionTooBusyException` is caught, here can trigger 
`flusherAndCompactor.onUpdate();`.



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