Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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 👍

if (configuredSegmentGranularity.equals(taskSegmentGranularity)) {
if (configuredSegmentGranularity == null
|| configuredSegmentGranularity.equals(taskSegmentGranularity)) {
return false;
}

LOG.info(
"Cancelling task [%s] as task segmentGranularity is [%s] but compaction config segmentGranularity is [%s]",
"Cancelling task[%s] as task segmentGranularity[%s] differs from compaction config segmentGranularity[%s].",
compactionTaskQuery.getId(), taskSegmentGranularity, configuredSegmentGranularity
);
overlordClient.cancelTask(compactionTaskQuery.getId());
Expand Down