Skip to content

Conversation

@codope
Copy link
Member

@codope codope commented Mar 10, 2022

What is the purpose of the pull request

TypedProperties#keys is not thread-safe. It was added in #4712 to ensure insertion order of properties is maintained. It was done in order to add a table checksum config in the end which would be used to validate that hoodie.properties is not written partially. However, TypedProperties not being thread-safe could result in ConcurrentModificationException as there are places in clustering where write config is passed to spark executor and it might happen that while one thread is trying to serialize it the other is trying to modify it. However, the solution to original problem need not depend on ordering. We can just add table checksum in the end and then while reading hoodie.properties just ensure that prop exists.

Brief change log

  • Remove TypedProperties#keys
  • Convert props to linked hashmap and then add table checksum config and then flush it to hoodie.properties.

Verify this pull request

(Please pick either of the following options)

This pull request is a trivial rework / code cleanup without any test coverage.

(or)

This pull request is already covered by existing tests, such as (please describe tests).

(or)

This change added tests and can be verified as follows:

(example:)

  • Added integration tests for end-to-end.
  • Added HoodieClientWriteTest to verify the change.
  • Manually verified the change by running a job locally.

Committer checklist

  • Has a corresponding JIRA in PR title & commit

  • Commit message is descriptive of the change

  • CI is green

  • Necessary doc changes done or have another open PR

  • For large changes, please consider breaking it into sub-tasks under an umbrella JIRA.

Copy link
Contributor

@nsivabalan nsivabalan left a comment

Choose a reason for hiding this comment

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

One comment on the ordering guarantees. but lets also incorporate the changes proposed in the jira.

@codope codope force-pushed the HUDI-3593-clustering-cme branch from a2e2b2e to f50fc26 Compare March 11, 2022 07:19
Copy link
Contributor

@nsivabalan nsivabalan left a comment

Choose a reason for hiding this comment

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

LGTM.

@nsivabalan nsivabalan added the priority:critical Production degraded; pipelines stalled label Mar 12, 2022
Create new TypedProperties while performing clustering

Add OrderedProperties and minor refactoring

Add javadoc and remove getters from OrderedProperties
@codope codope force-pushed the HUDI-3593-clustering-cme branch from f50fc26 to 5afecce Compare March 12, 2022 14:23
@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

@codope codope merged commit eee96e9 into apache:master Mar 13, 2022
vingov pushed a commit to vingov/hudi that referenced this pull request Apr 3, 2022
apache#5013)

Create new TypedProperties while performing clustering

Add OrderedProperties and minor refactoring

Add javadoc and remove getters from OrderedProperties
stayrascal pushed a commit to stayrascal/hudi that referenced this pull request Apr 12, 2022
apache#5013)

Create new TypedProperties while performing clustering

Add OrderedProperties and minor refactoring

Add javadoc and remove getters from OrderedProperties
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority:critical Production degraded; pipelines stalled

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants