Skip to content
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

[HUDI-7532] Include only compaction instants for lastCompaction in getDeltaCommitsSinceLatestCompaction #10915

Merged
merged 3 commits into from
May 15, 2024

Conversation

nsivabalan
Copy link
Contributor

@nsivabalan nsivabalan commented Mar 22, 2024

Change Logs

Fixing schedule compaction bug.
Looks like when polling timeline for last successful compaction commits, we also include replace commits. So, if a user sets clustering freq to 4 and compaction freq to 5, compaction scheduling may never kick in at all.

Impact

Scheduling of compaction will be triggered at the cadence configured.

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

low

Documentation Update

Describe any necessary documentation update if there is any new feature, config, or user-facing change. If not, put "none".

  • 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

@nsivabalan nsivabalan marked this pull request as ready for review March 22, 2024 22:33
@github-actions github-actions bot added the size:S PR with lines of changes in (10, 100] label Mar 22, 2024
@nsivabalan nsivabalan changed the title [HUDI-7532] Fixing schedule compaction bug [HUDI-7532] Include only compaction instants for lastCompaction in getDeltaCommitsSinceLatestCompaction Mar 22, 2024
@@ -147,6 +147,12 @@ public HoodieTimeline filterCompletedAndCompactionInstants() {
|| s.getAction().equals(HoodieTimeline.COMPACTION_ACTION)), details);
}

@Override
public HoodieTimeline filterCompletedCommitInstants() {
Copy link
Member

Choose a reason for hiding this comment

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

Let's unit test this.

@github-actions github-actions bot added size:L PR with lines of changes in (300, 1000] and removed size:S PR with lines of changes in (10, 100] labels Apr 17, 2024
@yihua
Copy link
Contributor

yihua commented May 3, 2024

@nsivabalan could you rebase the PR on the latest master and address the review comments?

@yihua yihua assigned nsivabalan and danny0405 and unassigned danny0405 May 14, 2024
@hudi-bot
Copy link

CI report:

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

Copy link
Contributor

@bvaradar bvaradar left a comment

Choose a reason for hiding this comment

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

Otherwise looks good.

.option("hoodie.keep.min.commits", "4")
.option("hoodie.keep.max.commits", "5")
.option("hoodie.clean.commits.retained", "3")
.option("hoodie.keep.min.commits", "16")
Copy link
Contributor

Choose a reason for hiding this comment

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

@nsivabalan : Why did we change this test along with this PR ? I am not able to follow the comments added inline.
cc @yihua

Copy link
Contributor Author

@nsivabalan nsivabalan May 14, 2024

Choose a reason for hiding this comment

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

hey @bvaradar : I had a long discussion w/ @danny0405 on this.
here is the issue:
our data table archival polls for compaction commit and does something based on that. Before this patch, we had a bug in canSchedule call wrt compaction scheduling. This patched fixed the issue as you might know.

But this specific test started to fail w/ FileNotFound. Apparently in HoodieCDCExtractor, we parse all entries in commit metadata and poll file status/listStatus for them.

Prior to this patch, due to archival behavior, every commit in active timeline is uncleaned and we were good. after this patch, apparently archival is trailing, and so we do have some commits in active timeline which are cleaned up and hence the fileStatus/listStatus polling results in FileNotFound Issue.

Danny agreed that this is a long pending/known limitation and we could definitely improve user exp by throwing some legible exception/error msg. But it increases the scope of this patch. so, we agreed to tweak the test so that it will not hit FileNotFound issue.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds good @nsivabalan . Can you file a jira to track this (if not already)

Copy link
Contributor

@bvaradar bvaradar left a comment

Choose a reason for hiding this comment

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

LGTM

@jonvex
Copy link
Contributor

jonvex commented May 15, 2024

image azure is actually passing

@jonvex jonvex merged commit 9e9bb90 into apache:master May 15, 2024
45 of 46 checks passed
yihua pushed a commit that referenced this pull request May 15, 2024
…tDeltaCommitsSinceLatestCompaction (#10915)

* Fixing schedule compaction bug

* Addressing comments

* Fixing CDC tests
yihua pushed a commit that referenced this pull request May 15, 2024
…tDeltaCommitsSinceLatestCompaction (#10915)

* Fixing schedule compaction bug

* Addressing comments

* Fixing CDC tests
yihua pushed a commit that referenced this pull request May 15, 2024
…tDeltaCommitsSinceLatestCompaction (#10915)

* Fixing schedule compaction bug

* Addressing comments

* Fixing CDC tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-0.15.0 size:L PR with lines of changes in (300, 1000] table-service
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants