Skip to content

Conversation

@bschell
Copy link
Contributor

@bschell bschell commented Jan 26, 2023

Updates the HoodieAvroRecordMerger to use the new precombine API instead of the deprecated one. This fixes issues with backwards compatibility with certain payloads.

Change Logs

Updates the HoodieAvroRecordMerger to use the new precombine API instead of the deprecated one. This fixes issues with backwards compatibility with certain payloads.

Impact

Fixes bugs

Risk level (write none, low medium or high below)

low

Documentation Update

none

Contributor's checklist

  • Read through contributor's guide
  • Change Logs and Impact were stated clearly
  • Adequate tests were added if applicable
  • CI passed

@yihua yihua added the priority:blocker Production down; release blocker label Jan 26, 2023
@yihua yihua requested a review from alexeykudinkin January 26, 2023 23:49
@alexeykudinkin
Copy link
Contributor

alexeykudinkin commented Jan 27, 2023

@bschell since this didn't fail any test, can we add/amend existing test validating the regression is fixed

@bschell bschell force-pushed the smallfix branch 2 times, most recently from 1b84c1d to 3027c66 Compare January 27, 2023 20:55
@bschell
Copy link
Contributor Author

bschell commented Jan 27, 2023

@alexeykudinkin I added an end-to-end test for PartialUpdateAvroPayload that catches this regression. While doing so I found and fixed another bug in HoodieAvroRecordMerger here: https://github.com/apache/hudi/blob/master/hudi-common/src/main/java/org/apache/hudi/common/model/HoodieAvroRecordMerger.java#L76

Basically HoodieMetadataPayload is not the only payload class that returns an entirely new payload. This breaks any of the "merge" payloads. I was thinking it might be even better to add this check as an API to HoodieRecordPayload so that we do not have to hardcode all the exceptions here but I kept the smaller change for now as we are deprecating this path later anyway.


import scala.collection.JavaConversions._

class TestPartialUpdateAvroPayloadE2E extends HoodieClientTestBase {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding the test @bschell!
We can drop the E2E suffix for it

// NOTE: When payload class returns a new payload instead of choosing from older/newer payload, create a new record.
return new HoodieAvroRecord(newer.getKey(), picked, newer.getOperation());
}
return picked.equals(((HoodieAvroRecord) newer).getData()) ? newer : older;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can nuke this optimization avoiding creation of the new record and just always create it in that case (to make sure this doesn't affect all random payloads out there)

@bschell bschell force-pushed the smallfix branch 2 times, most recently from 5a68b12 to 8bb7953 Compare January 28, 2023 00:35
Brandon Scheller added 2 commits January 27, 2023 22:23
Updates the HoodieAvroRecordMerger to use the new precombine API instead
of the deprecated one. This fixes issues with backwards compatibility.
@nsivabalan
Copy link
Contributor

rebased w/ laster master. we landed a flaky test fix which was causing failures w/ CI runs

@hudi-bot
Copy link
Collaborator

CI report:

Bot commands @hudi-bot supports the following commands:
  • @hudi-bot run azure re-run the last Azure build

@alexeykudinkin
Copy link
Contributor

@alexeykudinkin alexeykudinkin merged commit 9bbd71e into apache:master Jan 28, 2023
yihua pushed a commit that referenced this pull request Jan 30, 2023
Updates the HoodieAvroRecordMerger to use the new precombine API instead of the deprecated one. This fixes issues with backwards compatibility with certain payloads.
fengjian428 pushed a commit to fengjian428/hudi that referenced this pull request Jan 31, 2023
…che#7759)

Updates the HoodieAvroRecordMerger to use the new precombine API instead of the deprecated one. This fixes issues with backwards compatibility with certain payloads.
fengjian428 pushed a commit to fengjian428/hudi that referenced this pull request Apr 5, 2023
…che#7759)

Updates the HoodieAvroRecordMerger to use the new precombine API instead of the deprecated one. This fixes issues with backwards compatibility with certain payloads.
@ys8
Copy link

ys8 commented Jul 7, 2023

I believe it introduced a regression. The new record is always picking newer.getOperation() even if the older payload was picked. There is no guarantee that the operation is same between older and newer.

@danny0405
Copy link
Contributor

Yes, it is fixed in #8953

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority:blocker Production down; release blocker

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

7 participants