smengcl opened a new pull request, #11001:
URL: https://github.com/apache/ozone/pull/11001

   Generated-by: Claude Code (Opus 4.8)
   
   ## What changes were proposed in this pull request?
   
   `TestWatchForCommit.testWatchForCommitForRetryfailure` is intermittently 
failing (it is tagged `@Flaky("HDDS-5818")` and surfaces in the `integration 
(flaky)` check). The most common failure is:
   
   ```
   org.opentest4j.AssertionFailedError: Expected 
java.util.concurrent.ExecutionException to be thrown, but nothing was thrown.
     at 
...TestWatchForCommit.testWatchForCommitForRetryfailure(TestWatchForCommit.java:267)
   ```
   
   Root cause: the test shuts down two of three datanodes and expects 
`watchForCommit` for a not-yet-committed index to always throw. For the 
`ALL_COMMITTED` watch type this is not guaranteed. When the surviving node 
happens to be the Ratis leader, it answers the watch with 
`NotReplicatedException`, which `XceiverClientRatis.watchForCommit` handles by 
degrading to a majority reply and completing the future normally. In that case 
nothing is thrown and the assertion fails, so the outcome depends on leader 
placement.
   
   This change shuts down the Ratis leader plus one follower, so that no 
reachable leader remains. With no leader there is no `NotReplicatedException` 
to degrade an `ALL_COMMITTED` watch, so the watch fails deterministically for 
both watch types.
   
   It also replaces the previous `doesNotContain("Watch-MAJORITY_COMMITTED")` 
assertion with a deterministic replication-level check that asserts the client 
logged that the watch at the requested replication level failed. The old 
assertion was unsatisfiable in general: an `ALL_COMMITTED` watch intentionally 
falls back to a majority watch, and a `MAJORITY_COMMITTED` watch request itself 
contains that string, so it only passed via the `"Connection refused"` escape 
hatch. That assertion was itself a source of flakiness (the symptom originally 
reported on this Jira).
   
   The `closePipeline` step and the rest of the scenario are unchanged.
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-10788
   
   ## How was this patch tested?
   
   Ran `TestWatchForCommit#testWatchForCommitForRetryfailure` (both 
`MAJORITY_COMMITTED` and `ALL_COMMITTED` parameters) locally: `Tests run: 2, 
Failures: 0` across repeated runs, and the new replication-level assertion held 
for both watch types. `checkstyle` on the `ozone-integration-test` module 
passes. A single green run cannot fully prove non-flakiness, but the fix is 
deterministic by construction: with no reachable leader the graceful-degrade 
path is unreachable, so the watch always completes exceptionally.
   


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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to