Skip to content

[MINOR] Fix skew in clustering operator#12765

Merged
danny0405 merged 5 commits intoapache:masterfrom
Joy-2000:fix_cluster_operator_skew
Feb 14, 2025
Merged

[MINOR] Fix skew in clustering operator#12765
danny0405 merged 5 commits intoapache:masterfrom
Joy-2000:fix_cluster_operator_skew

Conversation

@Joy-2000
Copy link
Contributor

@Joy-2000 Joy-2000 commented Feb 3, 2025

Change Logs

related to #11757

same skew in clustering

image

Impact

none

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

none

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

@github-actions github-actions bot added the size:S PR with lines of changes in (10, 100] label Feb 3, 2025
LOG.info("Execute clustering plan for instant {} as {} file slices", clusteringInstantTime, clusteringGroup.getSlices().size());
output.collect(new StreamRecord<>(
new ClusteringPlanEvent(clusteringInstantTime, ClusteringGroupInfo.create(clusteringGroup), clusteringPlan.getStrategy().getStrategyParams())
new ClusteringPlanEvent(clusteringInstantTime, ClusteringGroupInfo.create(clusteringGroup), clusteringPlan.getStrategy().getStrategyParams(), operationIndex)
Copy link
Contributor

Choose a reason for hiding this comment

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

do we need a hash map like in this PR: https://github.com/apache/hudi/pull/11757/files

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fileids of each operation in clustering plan is unique. So I think a hash map is not necessary. WDYT

Copy link
Contributor

Choose a reason for hiding this comment

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

Is it possible the operation come from two different plans?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, a hash map here can only store operations of one plan.

Copy link
Contributor

Choose a reason for hiding this comment

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

Why, because the plan generator can actually handle multiple plans actually.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

// the first instant takes the highest priority.
Option<HoodieInstant> firstRequested = Option.fromJavaOptional(
    pendingClusteringInstantTimes.stream()
        .filter(instant -> instant.getState() == HoodieInstant.State.REQUESTED).findFirst());

The scheduleClustering method in ClusteringPlanOperator only handles the first plan each time.

Copy link
Contributor

Choose a reason for hiding this comment

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

let's add a hash map just like the compaction does.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok.

@hudi-bot
Copy link
Collaborator

hudi-bot commented Feb 6, 2025

CI report:

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

@danny0405 danny0405 merged commit 7380c26 into apache:master Feb 14, 2025
43 checks passed
voonhous pushed a commit to voonhous/hudi that referenced this pull request Apr 8, 2025
voonhous pushed a commit to voonhous/hudi that referenced this pull request Apr 9, 2025
voonhous pushed a commit to voonhous/hudi that referenced this pull request Apr 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-1.0.2 size:S PR with lines of changes in (10, 100]

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants