Skip to content

[HUDI-5671] BucketIndexPartitioner partition algorithm skew #7815

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
Feb 3, 2023

Conversation

loukey-lj
Copy link
Contributor

Change Logs

The online job runs for 13 days and finds that there are subtasks but no data processing, as shown in the figure below, this job uses the update time as the partition, uses the bucket index, the number of buckets is 128, and the write parallelism is 128. The key is uniform because the file size of each bucket is not much different from the storage point of view. After positioning, there is a skew in the shuffle algorithm.

image

Potential disadvantages of algorithmic tilt:

  1. The memory usage is uneven, some nodes may have high pressure on the JVM, and TM nodes are prone to timeout
  2. It may cause the checkpoint to time out, because the data will be flushed to hdfs during the snapshot state. If the skew is serious, it will cause some nodes to take too long and cause timeout.

current algorithm:
image

Algorithm flaws:

  1. curBucket ∈ [0, numBuckets -1]
  2. For the number of globalHash values in the same partition <= numBuckets number, globalHash is divergent, and mod(globalHash, numPartitions) is easy to conflict
  3. When numBuckets is relatively large, shuffleIndex is prone to conflicts, resulting in skew

Algorithm optimization:

image

kb = key % b; kb ∈ [0, b-1] pw = pt % w;

pw ∈ [0, w-1] shuffleIndex = (pw + kb) % w

shuffleIndex ∈ [0, w-1]

In fact, it is to calculate a pw according to the partition first. Pw can be understood as a slot Wn allocated to the partition. Different partitions have a slot.
Then move b slots back on the basis of this slot as the writing of data for this partition

image

Impact

NA

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

NA

Documentation Update

NA

  • The config description must be updated if new configs are added or the default value of the configs are changed
  • Any new feature or user-facing change requires updating the Hudi website. Please create a Jira ticket, attach the
    ticket number here and follow the instruction to make
    changes to the website.

Contributor's checklist

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

Sorry, something went wrong.

loukey-lj and others added 16 commits January 26, 2021 22:45

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
同步 hudi master

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@hudi-bot
Copy link

hudi-bot commented Feb 1, 2023

CI report:

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

@danny0405 danny0405 self-assigned this Feb 3, 2023
@danny0405 danny0405 added flink Issues related to flink index labels Feb 3, 2023
Copy link
Contributor

@danny0405 danny0405 left a comment

Choose a reason for hiding this comment

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

+1, nice improvement.

@danny0405 danny0405 merged commit 3282caa into apache:master Feb 3, 2023
yihua pushed a commit that referenced this pull request Feb 4, 2023

Verified

This commit was signed with the committer’s verified signature.
yihua Y Ethan Guo
neverdizzy added a commit to neverdizzy/hudi that referenced this pull request Feb 8, 2023
neverdizzy added a commit to neverdizzy/hudi that referenced this pull request Feb 9, 2023
XuQianJin-Stars pushed a commit that referenced this pull request Feb 11, 2023
nsivabalan pushed a commit to nsivabalan/hudi that referenced this pull request Mar 22, 2023
fengjian428 pushed a commit to fengjian428/hudi that referenced this pull request Apr 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flink Issues related to flink index priority:blocker
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

3 participants