droudnitsky commented on code in PR #7079:
URL: https://github.com/apache/hbase/pull/7079#discussion_r2147021795


##########
hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncRequestFutureImpl.java:
##########
@@ -561,6 +557,39 @@ private RegionLocations findAllLocationsOrFail(Action 
action, boolean useCache)
     return loc;
   }
 
+  /**
+   * For failing all actions that were being grouped during a 
groupAndSendMultiAction when operation
+   * timeout was exceeded and there is no time remaining to continue 
grouping/sending any of the
+   * actions. We don't fail any actions which have already failed to 
completion during grouping due
+   * to location error (they already have an error set and had action counter 
decremented for)
+   * @param actions                   actions being processed by the 
groupAndSend when operation
+   *                                  timeout occurred
+   * @param locateRegionFailedActions actions already failed to completion due 
to location error
+   * @param numAttempt                the number of attempts so far
+   */
+  private void failIncompleteActionsWithOpTimeout(List<Action> actions,
+    List<Action> locateRegionFailedActions, int numAttempt) {
+    String message = numAttempt == 1
+      ? "Operation timeout exceeded during resolution of region locations, "
+        + "prior to executing any actions."
+      : "Operation timeout exceeded during re-resolution of region locations 
on retry "
+        + (numAttempt - 1) + ".";
+    message += " Meta may be slow or operation timeout too short for batch 
size or retries.";
+    OperationTimeoutExceededException exception = new 
OperationTimeoutExceededException(message);
+
+    for (Action actionToFail : actions) {
+      // Action equality is implemented as row equality so we check action 
index equality
+      // since we don't want two different actions for the same row to be 
considered equal here
+      boolean actionAlreadyFailed =
+        locateRegionFailedActions != null && 
locateRegionFailedActions.stream().anyMatch(
+          failedAction -> failedAction.getOriginalIndex() == 
actionToFail.getOriginalIndex()
+            && failedAction.getReplicaId() == actionToFail.getReplicaId());
+      if (!actionAlreadyFailed) {

Review Comment:
   The logic for avoiding the assertion error is here, rest of the method is 
existing logic from `groupAndSendMulti` 



-- 
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-unsubscr...@hbase.apache.org

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

Reply via email to