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

   Generated-by: Claude Code (Opus 5.5)
   
   ## What changes were proposed in this pull request?
   
   `TestKeyInputStream#testSkip` writes a RATIS/THREE key and reads it right 
away, asserting an exact ReadChunk count from `XceiverClientMetrics`. A 
follower may not have applied the PutBlock yet, so a ReadChunk sent to it fails 
with `UNKNOWN_BCSID` and the client retries on another datanode. The metric 
counts every attempt, so the test intermittently sees 4 ReadChunk ops instead 
of 2:
   
   ```
   WARN  keyvalue.KeyValueHandler - Operation: ReadChunk , Message: Unable to 
find the block with bcsID 485. Container 9 bcsId is 483. , Result: UNKNOWN_BCSID
   ```
   
   The fix closes the key's container and waits until it is CLOSED on all 
replicas before reading (`OzoneTestHelper.waitForContainerClose`, already used 
by `testReadAfterReplication`). Followers apply the close only after the 
PutBlock (Ratis log order), so no replica can lag behind the block's bcsId.
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-16781
   
   ## How was this patch tested?
   
   - `mvn -pl :ozone-integration-test -am test -Dtest=TestKeyInputStream`: 4/4 
passed locally.
   - The fix removes the race by construction; a single green run cannot prove 
non-flakiness on its own.
   - 10x10 
[flaky-test-check](https://github.com/smengcl/hadoop-ozone/actions/runs/37740530899)
 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]

Reply via email to