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/08/24 20:31:36 UTC

[GitHub] [hbase] shahrs87 commented on a change in pull request #3611: [branch-1] HBASE-26195 Abort RS if wal sync fails or times out

shahrs87 commented on a change in pull request #3611:
URL: https://github.com/apache/hbase/pull/3611#discussion_r695180840



##########
File path: hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
##########
@@ -8120,27 +8097,29 @@ public Result append(Append mutate, long nonceGroup, long nonce) throws IOExcept
         rowLock = null;
       }
       // sync the transaction log outside the rowlock
+      walSyncSuccess = false;
       if(txid != 0){
         syncOrDefer(txid, durability);
       }
+      walSyncSuccess = true;
       if (rsServices != null && rsServices.getMetrics() != null) {
         rsServices.getMetrics().updateWriteQueryMeter(this.htableDescriptor.
           getTableName());
       }
-      doRollBackMemstore = false;
+    } catch (Throwable t) {
+      // If wal sync fails, then abort the Region server
+      if (!walSyncSuccess) {
+        rsServices.abort("Wal sync failed", t);

Review comment:
       I tried to do that. I created this helper function.
   ```
     private void handleException(Throwable t, boolean walSyncSuccess) throws Throwable {
       // If wal sync fails, then abort the Region server
       if (!walSyncSuccess) {
         rsServices.abort("Wal sync failed", t);
       }
       // Rethrow the exception.
       throw t;
     }
   ```
   Since this function throws `Throwable` and the `doMiniBatchMutation` method throws IOException and not Throwable, Intellij is throwing compile time error, but within catch block of `doMiniBatchMutation` (without the helper method) , if I throw Throwable, it is fine.
   
   I can change the handleException to accept IOException and throw back IOException but that won't cover all the errors coming out of wal sync.
   @gjacoby126 




-- 
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: issues-unsubscribe@hbase.apache.org

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