capistrant commented on code in PR #20267:
URL: https://github.com/apache/druid/pull/20267#discussion_r3991247219


##########
server/src/main/java/org/apache/druid/segment/loading/SegmentLocalCacheManager.java:
##########
@@ -1116,8 +1117,13 @@ private DataSegment loadPartial(DataSegment dataSegment) 
throws SegmentLoadingEx
           final Set<String> selected = Set.copyOf(
               wrapper.getSelectedBundleNames(dataSegment, 
mapper.getSegmentFileMetadata())
           );
+          // Snapshot the rule this call is about to replace, then pin the 
UNION of it and the new selection for the
+          // duration of the attempt.
           final String priorFingerprint = metadata.getRuleFingerprint();
-          metadata.applyRule(wrapper.getFingerprint(), selected);
+          final Set<String> priorSelection = 
metadata.getRuleSelectedBundleNames();
+          final Set<String> attemptSelection = new HashSet<>(priorSelection);
+          attemptSelection.addAll(selected);
+          metadata.applyRule(wrapper.getFingerprint(), attemptSelection);

Review Comment:
   seems reasonable to consider adding an info file re-write to the restore 
prior flow 



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