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

   ## What changes were proposed in this pull request?
   
   This patch fixes overwrite detection for existing FILE_PER_CHUNK containers. 
Chunk offsets are relative to the block, but each chunk is stored in a separate 
file starting at offset zero. Comparing the block offset with the chunk file 
length incorrectly treats retries of non-first chunks as new writes.
   
   This causes COMBINED retries to double-count container bytesUsed. Repeated 
COMMIT_DATA also fails when the temporary file has already been moved to the 
final chunk file.
   
   The patch extends the existing overwrite helper to accept a file-relative 
offset and uses offset zero for FILE_PER_CHUNK. FILE_PER_BLOCK retains its 
existing behavior. Regression tests cover both retry paths at zero and nonzero 
block offsets.
   
   ## What is the link to the Apache JIRA
   
   [HDDS-16874](https://issues.apache.org/jira/browse/HDDS-16874)
   
   ## How was this patch tested?
   
   The regression tests reproduced both issues before the fix: nonzero-offset 
COMBINED retries increased bytesUsed from 20 to 40, and repeated COMMIT_DATA 
failed with NoSuchFileException. Zero-offset cases passed.
   
   After the fix, all 44 tests passed across TestFilePerChunkStrategy, 
TestFilePerBlockStrategy, and TestChunkUtils. The project checkstyle script and 
git diff --check also passed.
   
   Datanode restart and pipeline closure were not tested end to end.


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