mirror of https://github.com/apache/druid.git
Fix NPE in CompactSegments (#16713)
This commit is contained in:
parent
7c625356c5
commit
616ae631c6
|
@ -234,12 +234,13 @@ public class CompactSegments implements CoordinatorCustomDuty
|
||||||
Granularity configuredSegmentGranularity = dataSourceCompactionConfig.getGranularitySpec()
|
Granularity configuredSegmentGranularity = dataSourceCompactionConfig.getGranularitySpec()
|
||||||
.getSegmentGranularity();
|
.getSegmentGranularity();
|
||||||
Granularity taskSegmentGranularity = compactionTaskQuery.getGranularitySpec().getSegmentGranularity();
|
Granularity taskSegmentGranularity = compactionTaskQuery.getGranularitySpec().getSegmentGranularity();
|
||||||
if (configuredSegmentGranularity.equals(taskSegmentGranularity)) {
|
if (configuredSegmentGranularity == null
|
||||||
|
|| configuredSegmentGranularity.equals(taskSegmentGranularity)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
LOG.info(
|
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
|
compactionTaskQuery.getId(), taskSegmentGranularity, configuredSegmentGranularity
|
||||||
);
|
);
|
||||||
overlordClient.cancelTask(compactionTaskQuery.getId());
|
overlordClient.cancelTask(compactionTaskQuery.getId());
|
||||||
|
|
Loading…
Reference in New Issue