Zakelly commented on code in PR #27042:
URL: https://github.com/apache/flink/pull/27042#discussion_r2386824371


##########
flink-state-backends/flink-statebackend-forst/src/main/java/org/apache/flink/state/forst/datatransfer/DataTransferStrategyBuilder.java:
##########
@@ -122,23 +123,28 @@ private static boolean 
isDbPathUnderCheckpointPathForSnapshot(
 
     public static DataTransferStrategy buildForRestore(
             @Nullable ForStFlinkFileSystem forStFlinkFileSystem,
+            ForStPathContainer forStPathContainer,
             Collection<StateHandleTransferSpec> specs,
             RecoveryClaimMode recoveryClaimMode) {
         DataTransferStrategy strategy;
         FileSystem cpSharedFs = getSharedStateFileSystem(specs);
+        boolean isDbUnderSameJobPathFromRestore =
+                isDbUnderSameJobPathFromRestore(forStPathContainer, specs);
         if (forStFlinkFileSystem == null
                 || cpSharedFs == null
                 || !forStFlinkFileSystem.getUri().equals(cpSharedFs.getUri())
-                || recoveryClaimMode == RecoveryClaimMode.NO_CLAIM) {
+                || (!isDbUnderSameJobPathFromRestore
+                        && recoveryClaimMode == RecoveryClaimMode.NO_CLAIM)) {
             strategy =
                     forStFlinkFileSystem == null
                             ? new CopyDataTransferStrategy()
                             : new 
CopyDataTransferStrategy(forStFlinkFileSystem);
             LOG.info(
-                    "Build DataTransferStrategy for Restore: {}, 
forStFlinkFileSystem: {}, cpSharedFs:{}, recoveryClaimMode:{}",
+                    "Build DataTransferStrategy for Restore: {}, 
forStFlinkFileSystem: {}, cpSharedFs:{}, isDbUnderSameJobPathFromRestore:{}, 
recoveryClaimMode:{}",

Review Comment:
   I'd suggest we make this log as debug level one, as well the one in 
`buildForSnapshot`



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

Reply via email to