HIVE-29744: Concurrent INSERT INTO on new dynamic partition causes data loss (non-ACID)#6613
Merged
Merged
Conversation
…ta loss (non-ACID)
difin
marked this pull request as ready for review
July 16, 2026 22:48
deniskuzZ
reviewed
Jul 17, 2026
| // TODO: why is "&& !isAcidIUDoperation" needed here? | ||
| if (!isTxnTable && ((loadFileType == LoadFileType.REPLACE_ALL) || (oldPart == null && !isAcidIUDoperation))) { | ||
| if (!isTxnTable && ((loadFileType == LoadFileType.REPLACE_ALL) | ||
| || (oldPart == null && !isAcidIUDoperation && loadFileType != LoadFileType.KEEP_EXISTING))) { |
Member
There was a problem hiding this comment.
why do we need isAcidIUDoperation check? isn't it already covered by isTxnTable ?
Member
There was a problem hiding this comment.
if (!isTxnTable && (loadFileType == LoadFileType.REPLACE_ALL
|| (oldPart == null && loadFileType != LoadFileType.KEEP_EXISTING))) {
...
}
Contributor
Author
There was a problem hiding this comment.
Yes, it seems redundant. Removed.
|
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.



What changes were proposed in this pull request?
Updated
Hive.loadPartitionInternal()soINSERT INTOcommits append files instead of replacing the partition directory when the partition is not yet in the metastore.Why are the changes needed?
INSERT INTOshould append data, but concurrent loads into a new dynamic partition can delete each other’s files during theMoveTaskcommit. That causes silent data loss with no query failure. The fix restores correct append behavior for non-ACIDINSERT INTOwithout requiring write serialization.Does this PR introduce any user-facing change?
No
How was this patch tested?
Added new test class
TestHiveLoadPartitionKeepExistingcovering append, overwrite, and concurrent commit scenarios.