AmatyaAvadhanula commented on code in PR #16162:
URL: https://github.com/apache/druid/pull/16162#discussion_r1578944004


##########
server/src/main/java/org/apache/druid/segment/realtime/appenderator/StreamAppenderator.java:
##########
@@ -1138,21 +1164,26 @@ public void registerNewVersionOfPendingSegment(
 
     // Announce segments
     final DataSegment baseSegment = sinks.get(basePendingSegment).getSegment();
+    final DataSegment newSegment = getUpgradedSegment(baseSegment, 
newSegmentVersion);
 
-    final DataSegment newSegment = new DataSegment(
-        newSegmentVersion.getDataSource(),
-        newSegmentVersion.getInterval(),
-        newSegmentVersion.getVersion(),
+    segmentAnnouncer.announceSegment(newSegment);
+    
baseSegmentToUpgradedSegments.get(basePendingSegment).add(newSegmentVersion);
+    upgradedSegmentToBaseSegment.put(newSegmentVersion, basePendingSegment);

Review Comment:
   We ensure that the base segment has been added for every sink that is 
present.
   i.e the set in the value of the map needs to contain the key as well.



-- 
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