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

Fix NPE in CompactSegments #16713

Merged
merged 1 commit into from
Jul 10, 2024
Merged

Conversation

kfaraz
Copy link
Contributor

@kfaraz kfaraz commented Jul 10, 2024

The NPE causes CompactSegments duty to fail and thus not submit any compaction tasks.

Copy link
Contributor

@AmatyaAvadhanula AmatyaAvadhanula left a comment

Choose a reason for hiding this comment

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

Thanks for the fix @kfaraz

@@ -234,12 +234,13 @@ private boolean cancelTaskIfGranularityChanged(
Granularity configuredSegmentGranularity = dataSourceCompactionConfig.getGranularitySpec()
.getSegmentGranularity();
Granularity taskSegmentGranularity = compactionTaskQuery.getGranularitySpec().getSegmentGranularity();
Copy link
Contributor

@abhishekrb19 abhishekrb19 Jul 10, 2024

Choose a reason for hiding this comment

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

The fix makes sense. It seems that the members and getters in UserCompactionTaskGranularityConfig are missing @Nullable annotations. Could we also update those?

Also, for this bug fix, it'll be good to update an existing test in CompactSegmentsTest or another relevant test to pass null values to the compaction task query.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Some of the @Nullable annotations are being added in another PR #16291 , so I skipped them here.
Okay if we add the tests separately? I want to merge this PR and not wait for another CI build.

Copy link
Contributor

Choose a reason for hiding this comment

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

Works for me 👍

@asdf2014 asdf2014 merged commit 616ae63 into apache:master Jul 10, 2024
88 checks passed
@kfaraz kfaraz deleted the fix_auto_compact_npe branch July 10, 2024 07:03
@kfaraz
Copy link
Contributor Author

kfaraz commented Jul 10, 2024

Thanks for the prompts reviews, @AmatyaAvadhanula , @abhishekrb19 , @asdf2014 !

sreemanamala pushed a commit to sreemanamala/druid that referenced this pull request Aug 6, 2024
@kfaraz kfaraz added this to the 31.0.0 milestone Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants