Skip to content

Fix NPE in CompactSegments#16713

Merged
asdf2014 merged 1 commit intoapache:masterfrom
kfaraz:fix_auto_compact_npe
Jul 10, 2024
Merged

Fix NPE in CompactSegments#16713
asdf2014 merged 1 commit intoapache:masterfrom
kfaraz:fix_auto_compact_npe

Conversation

@kfaraz
Copy link
Copy Markdown
Contributor

@kfaraz kfaraz commented Jul 10, 2024

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

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
@kfaraz kfaraz deleted the fix_auto_compact_npe branch July 10, 2024 07:03
@kfaraz
Copy link
Copy Markdown
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