kfaraz commented on code in PR #16393:
URL: https://github.com/apache/druid/pull/16393#discussion_r1592628285


##########
indexing-service/src/main/java/org/apache/druid/indexing/common/actions/SegmentTransactionalReplaceAction.java:
##########
@@ -140,26 +153,29 @@ public SegmentPublishResult perform(Task task, 
TaskActionToolbox toolbox)
               )
               .build()
       );
+
+      IndexTaskUtils.emitSegmentPublishMetrics(publishResult, task, toolbox);
+
+      // Upgrade any overlapping pending segments
+      // Do not perform upgrade in the same transaction as replace commit so 
that
+      // failure to upgrade pending segments does not affect success of the 
commit
+      if (publishResult.isSuccess() && toolbox.getSupervisorManager() != null) 
{
+        try {
+          registerUpgradedPendingSegmentsOnSupervisor(task, toolbox, 
publishResult.getUpgradedPendingSegments());
+        }
+        catch (Exception e) {
+          log.error(e, "Error while upgrading pending segments for task[%s]", 
task.getId());
+        }

Review Comment:
   It feels a little weird to have this try-catch inside the outer try-catch.
   Maybe we could move this try-catch into the method 
`registerUpgradePendingSegments...` and rename it to 
`tryRegisterUpgradePendingSegments...` to denote that it throws no exceptions.



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