gianm commented on code in PR #20006:
URL: https://github.com/apache/druid/pull/20006#discussion_r3785857560


##########
server/src/main/java/org/apache/druid/segment/realtime/appenderator/BaseAppenderatorDriver.java:
##########
@@ -686,12 +687,18 @@ ListenableFuture<SegmentsAndCommitMetadata> 
publishInBackground(
 
                     // Clean up pushed segments if they are physically 
disjoint from the published ones (this means
                     // they were probably pushed by a replica, and with the 
unique paths option).
-                    final boolean physicallyDisjoint = Sets.intersection(
-                        
publishedSegments.stream().map(DataSegment::getLoadSpec).collect(Collectors.toSet()),
-                        
ourSegments.stream().map(DataSegment::getLoadSpec).collect(Collectors.toSet())
-                    ).isEmpty();
+                    final Set<Map<String, Object>> publishedLoadSpecs =
+                        
publishedSegments.stream().map(DataSegment::getLoadSpec).collect(Collectors.toSet());
+                    final Set<Map<String, Object>> ourLoadSpecs =
+                        
ourSegments.stream().map(DataSegment::getLoadSpec).collect(Collectors.toSet());
+
+                    if (publishedLoadSpecs.contains(null) || 
ourLoadSpecs.contains(null)) {
+                      // We don't expect loadSpecs to be missing. If they are, 
it may indicate a bug in something.
+                      throw DruidException.defensive("Unexpectedly null 
loadSpec encountered");

Review Comment:
   I updated this to include the segment ID and also `published` vs `ours` in 
the error message.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to