This is an automated email from the ASF dual-hosted git repository.

asdf2014 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/druid.git


The following commit(s) were added to refs/heads/master by this push:
     new 616ae631c62 Fix NPE in CompactSegments (#16713)
616ae631c62 is described below

commit 616ae631c62a98d2145af0a87a0e2ab3af199d1f
Author: Kashif Faraz <[email protected]>
AuthorDate: Tue Jul 9 23:51:52 2024 -0700

    Fix NPE in CompactSegments (#16713)
---
 .../org/apache/druid/server/coordinator/duty/CompactSegments.java    | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git 
a/server/src/main/java/org/apache/druid/server/coordinator/duty/CompactSegments.java
 
b/server/src/main/java/org/apache/druid/server/coordinator/duty/CompactSegments.java
index 27f6d17638d..335912fe23e 100644
--- 
a/server/src/main/java/org/apache/druid/server/coordinator/duty/CompactSegments.java
+++ 
b/server/src/main/java/org/apache/druid/server/coordinator/duty/CompactSegments.java
@@ -234,12 +234,13 @@ public class CompactSegments implements 
CoordinatorCustomDuty
     Granularity configuredSegmentGranularity = 
dataSourceCompactionConfig.getGranularitySpec()
                                                                          
.getSegmentGranularity();
     Granularity taskSegmentGranularity = 
compactionTaskQuery.getGranularitySpec().getSegmentGranularity();
-    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());


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to