smengcl opened a new pull request, #11691: URL: https://github.com/apache/ozone/pull/11691
Generated-by: Claude Code (Opus 5.5) ## What changes were proposed in this pull request? `TestDeleteContainerHandler` failed with 3 of 6 tests timing out in `OzoneTestUtils#waitBlockDeleted`. This is the same race as HDDS-17213. `setup` only waits for SCM to report an OPEN RATIS/ONE pipeline. The first key write of the class reached the new Ratis group before its leader was ready. WriteChunk and PutBlock were both rejected with `LeaderNotReadyException`; on retry the PutBlock was applied without its WriteChunk, failed with "Chunk file not found", and the replica of container #1 was marked UNHEALTHY. The client then wrote the key to another container. On key commit, OM sent the uncommitted block of container #1 to SCM for deletion. Container #1 stays CLOSING in SCM with an UNHEALTHY replica, so `DeletedBlockLogImpl#getTransactions` skips that transaction on every run and never removes it. All tests share one cluster, so with this stale transaction in the log `waitBlockDeleted` (waits for zero transactions) times out in every later test that calls it. The fix waits in `setup` until the datanode's Ratis division of the pipeline reports `isLeaderReady()` before the first write, as done for `TestFinalizeBlock` in HDDS-17213. ## What is the link to the Apache JIRA https://issues.apache.org/jira/browse/HDDS-17311 ## How was this patch tested? - `mvn -pl :ozone-integration-test -am test -Dtest=TestDeleteContainerHandler`: 6/6 passed locally, with no `LeaderNotReadyException` and no UNHEALTHY container in the output. - The fix removes the race by construction: no write is sent until the only pipeline's leader is ready. One green run alone cannot prove that. - 10x10 [flaky-test-check](https://github.com/smengcl/hadoop-ozone/actions/runs/39760101894) on this branch: in progress 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- 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]
