tkhurana commented on code in PR #2491:
URL: https://github.com/apache/phoenix/pull/2491#discussion_r3326041694
##########
phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexRegionObserverMutationBlockingIT.java:
##########
@@ -277,12 +278,276 @@ public void
testSystemHAGroupTableMutationsAllowedDuringActiveToStandby() throws
}
}
+ /**
+ * Walks the cause chain of a {@link CommitException} looking for a
+ * {@link MutationBlockedIOException}. Handles two paths:
+ * <ul>
+ * <li>Direct chain — {@code MutationBlockedIOException} now extends
+ * {@link org.apache.hadoop.hbase.DoNotRetryIOException}, so HBase's
RPC retry layers
+ * fail-fast and propagate the exception without wrapping it in
+ * {@link RetriesExhaustedWithDetailsException}.</li>
+ * <li>REWDE-wrapped — the legacy retry path; preserved here for any
caller that still
+ * reaches it (defense-in-depth).</li>
+ * </ul>
+ */
private boolean containsMutationBlockedException(CommitException e) {
- Throwable cause = e.getCause();
- if (cause instanceof RetriesExhaustedWithDetailsException) {
- RetriesExhaustedWithDetailsException re =
(RetriesExhaustedWithDetailsException) cause;
- return re.getCause(0) instanceof MutationBlockedIOException;
+ Throwable t = e.getCause();
+ while (t != null) {
+ if (t instanceof MutationBlockedIOException) {
+ return true;
+ }
+ if (t instanceof RetriesExhaustedWithDetailsException) {
+ RetriesExhaustedWithDetailsException re =
(RetriesExhaustedWithDetailsException) t;
+ for (int i = 0; i < re.getNumExceptions(); i++) {
+ if (re.getCause(i) instanceof MutationBlockedIOException) {
+ return true;
+ }
+ }
+ }
+ t = t.getCause();
}
return false;
}
+
+ /**
+ * Regression test for the dual-path fail-fast fix on the batched-mutation
path:
+ * <ul>
+ * <li><b>Server-side change:</b> {@link MutationBlockedIOException}
extends
+ * {@code DoNotRetryIOException}, signaling intent to fail fast.</li>
+ * <li><b>Phoenix client-side intercept:</b> {@code MutationState.send}'s
catch block
+ * inspects the cause chain via {@code findDoNotRetryCauseInChain} and
short-circuits
Review Comment:
The actual method is findHaFailoverCauseInChain
--
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]