fix(payload): support sentinel no-op updates in DefaultHoodieRecordPayload#18413
Open
suryaprasanna wants to merge 2 commits intoapache:masterfrom
Open
fix(payload): support sentinel no-op updates in DefaultHoodieRecordPayload#18413suryaprasanna wants to merge 2 commits intoapache:masterfrom
suryaprasanna wants to merge 2 commits intoapache:masterfrom
Conversation
Collaborator
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #18413 +/- ##
============================================
- Coverage 68.21% 68.19% -0.03%
+ Complexity 27709 27702 -7
============================================
Files 2440 2440
Lines 134249 134257 +8
Branches 16179 16181 +2
============================================
- Hits 91578 91551 -27
- Misses 35565 35591 +26
- Partials 7106 7115 +9
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
danny0405
reviewed
Mar 30, 2026
| * | ||
| * @see DefaultHoodieRecordPayload | ||
| */ | ||
| public static final String UPDATE_ON_SAME_PAYLOAD_ORDERING_FIELD_PROP_KEY = "hoodie.payload.update.on.same.ordering.field"; |
Contributor
There was a problem hiding this comment.
The payload class is deprecated, we are not adding new functions to it, should we just add a new payload class impl or just extend the merge mode.
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.
Describe the issue this Pull Request addresses
This PR updates
DefaultHoodieRecordPayloadto avoid rewriting records when the incoming payload should not win the merge based on ordering semantics. Instead of returning the current persisted record, it can return a sentinel no-op result so the existing record is preserved without an unnecessary rewrite. The change also makes equal-ordering behavior configurable.Summary and Changelog
Changes:
SENTINELfromcombineAndGetUpdateValue()when the incoming record should not update the persisted recordcanProduceSentinel()support inDefaultHoodieRecordPayloadhoodie.payload.update.on.same.ordering.fieldconfig with defaulttrueImpact
Changes merge behavior for
DefaultHoodieRecordPayloadwhen the incoming record should be ignored. This can reduce unnecessary rewrites and preserve the existing persisted record as-is. Also introduces a new payload config for equal-ordering handling.Risk Level
medium
This changes merge semantics for the default payload by introducing sentinel-based no-op behavior. Verification was done with targeted unit tests for
TestDefaultHoodieRecordPayload, including older, newer, equal-ordering, and default-config cases.Documentation Update
Config documentation should be updated for
hoodie.payload.update.on.same.ordering.field.Contributor's checklist