HADOOP-19902. [ABFS] Fix small write hflush followed by close#8513
Open
sunchao wants to merge 1 commit into
Open
HADOOP-19902. [ABFS] Fix small write hflush followed by close#8513sunchao wants to merge 1 commit into
sunchao wants to merge 1 commit into
Conversation
|
🎊 +1 overall
This message was automatically generated. |
Member
Author
|
cc @anmolanmol1234 @anujmodi2021 @steveloughran, could you review this? It addresses a failure in the small-write append-with-flush path: after |
Member
Author
|
we encountered this while using Parquet 1.15.2 without this PR apache/parquet-java#3204 |
anmolanmol1234
approved these changes
May 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why are the changes needed?
With
fs.azure.write.enableappendwithflush=true, ABFS's small-write optimizedhflush()submits and consumes the activeDataBlockbut leaves it recorded as the active writable block. A laterclose()retries that already consumed block and fails withIllegalStateException: Expected stream state Writing -but actual state is Closed.JIRA: HADOOP-19902
What changes were proposed in this PR?
Clear the active block after the optimized append-with-flush path submits it for upload, matching the lifecycle already used by
uploadCurrentBlock().Add a regression test with small-write optimization enabled that executes
write(),hflush(), andclose(), then asserts the payload is appended exactly once usingFLUSH_MODE.Contains content generated by Codex.
How was this PR tested?
./mvnw -pl hadoop-tools/hadoop-azure -am -DskipITs -Dtest=org.apache.hadoop.fs.azurebfs.services.TestAbfsOutputStream#verifySmallWriteOptimizedHFlushFollowedByClose -DfailIfNoTests=false testAI Tooling
Contains content generated by Codex.