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-1955]Fix the filter condition is missing in the judgment condition of comp… #3025

Merged
merged 1 commit into from Jun 16, 2021

Conversation

swuferhong
Copy link
Contributor

…action instance

Tips

What is the purpose of the pull request

The filter condition is missing in the judgment condition of compaction instance in BaseScheduleCompactionActionExecutor.java. In method execute(), it needs a filter condition, but now it don't have.

Brief change log

(for example:)

  • Modify AnnotationLocation checkstyle rule in checkstyle.xml

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.

@codecov-commenter
Copy link

codecov-commenter commented Jun 3, 2021

Codecov Report

Merging #3025 (354df97) into master (61efc6a) will increase coverage by 0.04%.
The diff coverage is 0.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #3025      +/-   ##
============================================
+ Coverage     45.75%   45.80%   +0.04%     
- Complexity     5262     5275      +13     
============================================
  Files           909      909              
  Lines         39356    39419      +63     
  Branches       4239     4250      +11     
============================================
+ Hits          18008    18056      +48     
- Misses        19504    19516      +12     
- Partials       1844     1847       +3     
Flag Coverage Δ
hudicli 39.95% <ø> (ø)
hudiclient 30.39% <0.00%> (ø)
hudicommon 47.56% <ø> (ø)
hudiflink 60.98% <ø> (+0.24%) ⬆️
hudihadoopmr 51.29% <ø> (ø)
hudisparkdatasource 66.47% <ø> (ø)
hudisync 51.45% <ø> (ø)
huditimelineservice 64.36% <ø> (ø)
hudiutilities 56.63% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
.../compact/BaseScheduleCompactionActionExecutor.java 0.00% <0.00%> (ø)
...ache/hudi/sink/StreamWriteOperatorCoordinator.java 72.13% <0.00%> (+1.84%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 61efc6a...354df97. Read the comment docs.

@danny0405
Copy link
Contributor

Hi, @vinothchandar , can you take a look for this small fix, i'm confident that this may be a bug here ~

@@ -63,7 +63,7 @@ public BaseScheduleCompactionActionExecutor(HoodieEngineContext context,
+ ", Compaction scheduled at " + instantTime));
// Committed and pending compaction instants should have strictly lower timestamps
List<HoodieInstant> conflictingInstants = table.getActiveTimeline()
.getWriteTimeline().getInstants()
.getWriteTimeline().filterCompletedAndCompactionInstants().getInstants()
Copy link
Contributor

Choose a reason for hiding this comment

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

@swuferhong @danny0405 If you take a look at the previous version of this file, the method is called before was commitsAndCompactionTimeline ->

public HoodieDefaultTimeline getCommitsAndCompactionTimeline() {

This follows the same behavior as getWriteTimeline().getInstants(). Can you please explain what is a possible bug here ?

Copy link
Contributor

Choose a reason for hiding this comment

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

No, the method getWriteTimeline() does not really follow the behavior of filterCompletedAndCompactionInstants,
getWriteTimeline() actually may include any INFLIGHT instants but filterCompletedAndCompactionInstants only include COMPACTION INFLIGHT instants.

We should allow scheduling compaction if there are inflight commits or inflight delta_commits.

Copy link
Contributor

@n3nash n3nash Jun 15, 2021

Choose a reason for hiding this comment

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

@danny0405 This class was NOT using filterCompletedAndCompactionInstants before. It was using commitsAndCompactionTimeline(). See this -> https://github.com/apache/hudi/blob/release-0.7.0/hudi-client/hudi-client-common/src/main/java/org/apache/hudi/table/action/compact/BaseScheduleCompactionActionExecutor.java#L65
Let me know if there is any confusion.

Copy link
Contributor

Choose a reason for hiding this comment

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

Take a look at the comments

// Committed and pending compaction instants should have strictly lower timestamps

I think the code before that used commitsAndCompactionTimeline() is already wrong, it add restrictions that we can not generate compaction plan when there are inflight commits, of course we can actually.

Copy link
Contributor

Choose a reason for hiding this comment

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

Okay got it. So you're saying this bug was always there even in 0.7 release ? Can we please add a test case for this before landing ?

Copy link
Contributor

Choose a reason for hiding this comment

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

Sure, let us add a test case.

Copy link
Contributor

@n3nash n3nash left a comment

Choose a reason for hiding this comment

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

@danny0405 @swuferhong Left a comment, PTAL

PR Tracker Board automation moved this from Under Discussion PRs to Nearing Landing Jun 14, 2021
@hudi-bot
Copy link

hudi-bot commented Jun 15, 2021

CI report:

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

@swuferhong swuferhong closed this Jun 16, 2021
PR Tracker Board automation moved this from Nearing Landing to Done Jun 16, 2021
@swuferhong swuferhong reopened this Jun 16, 2021
PR Tracker Board automation moved this from Done to Under Discussion PRs Jun 16, 2021
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, @n3nash please take a look again, thanks.

Copy link
Contributor

@n3nash n3nash left a comment

Choose a reason for hiding this comment

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

LGTM!

PR Tracker Board automation moved this from Under Discussion PRs to Nearing Landing Jun 16, 2021
@n3nash n3nash merged commit 5ce64a8 into apache:master Jun 16, 2021
PR Tracker Board automation moved this from Nearing Landing to Done Jun 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

None yet

5 participants