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


##########
server/src/main/java/org/apache/druid/segment/loading/SegmentLocalCacheManager.java:
##########
@@ -1663,6 +1671,71 @@ public File toPotentialLocation(final File location)
       return new File(location, relativePathString);
     }
 
+    /**
+     * Returns the cache directory of the base segment (the segment this one 
was upgraded from) on the given storage
+     * location if it is present and not corrupted, or null otherwise.
+     */
+    @GuardedBy("entryLock")
+    @Nullable
+    private File findCachedBaseSegmentDir(final StorageLocation mountLocation)
+    {
+      if (upgradedFromSegmentId == null) {
+        return null;
+      }
+      final File baseDir = new File(mountLocation.getPath(), 
upgradedFromSegmentId.toString());
+      if (baseDir.exists() && !isPossiblyCorrupted(baseDir)) {
+        return baseDir;
+      }
+      return null;
+    }
+
+    /**
+     * Copies files from the base segment's cache directory into the upgraded 
segment's cache directory,
+     * avoiding a deep-storage download. Uses a start-marker for crash safety, 
consistent with
+     * {@link #loadInLocationWithStartMarker}.
+     */
+    @GuardedBy("entryLock")
+    private void copyFromBaseSegmentDir(final File baseDir, final File destDir)

Review Comment:
   This method needs to hold the `entryLock` for the base segment too.



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