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


##########
server/src/main/java/org/apache/druid/segment/loading/SegmentLocalCacheManager.java:
##########
@@ -950,6 +958,15 @@ private ReservedPartial findOrReservePartial(DataSegment 
dataSegment, SegmentRan
   {
     final ReservedPartial existing = 
findExistingPartialWithHold(dataSegment.getId());
     if (existing != null) {
+      if (!existing.metadata().isMounted()) {
+        // rewrite the info file if it is missing
+        try {
+          storeInfoFile(dataSegment);

Review Comment:
   Two things:
   
   1) The code that writes info files could use a cleanup. I think it would 
improve things to run it all through `rewriteInfoFile`, i.e., make 
`storeInfoFile` call `rewriteInfoFile`, and also make the `if (hold != null)` 
branch in `acquireSegment` call `rewriteInfoFile`. It would be easier to track 
through all the places that can write an info file.
   
   2) Do we need to register a hook here to delete the info file on unmount?



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