Myasuka commented on a change in pull request #18222:
URL: https://github.com/apache/flink/pull/18222#discussion_r776135249



##########
File path: 
flink-state-backends/flink-statebackend-rocksdb/src/main/java/org/apache/flink/contrib/streaming/state/restore/RocksDBHandle.java
##########
@@ -202,12 +202,21 @@ private void restoreInstanceDirectoryFromPath(Path 
source) throws IOException {
             final String fileName = file.getFileName().toString();
             final Path targetFile = instanceRocksDBDirectory.resolve(fileName);
             if (fileName.endsWith(SST_FILE_SUFFIX)) {
-                // hardlink'ing the immutable sst-files.
-                Files.createLink(targetFile, file);
-            } else {
-                // true copy for all other files.
-                Files.copy(file, targetFile, 
StandardCopyOption.REPLACE_EXISTING);
+                try {
+                    // hardlink'ing the immutable sst-files.
+                    Files.createLink(targetFile, file);
+                    continue;
+                } catch (IOException ioe) {
+                    logger.debug(
+                            String.format(
+                                    "Could not hard link sst file %s. Trying 
to copy it over.",
+                                    fileName),
+                            ioe);
+                }
             }
+
+            // true copy for all other files and files that could not be hard 
linked.
+            Files.copy(file, targetFile, StandardCopyOption.REPLACE_EXISTING);

Review comment:
       There exist other files in RocksDB folder without `.sst` suffix.




-- 
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: issues-unsubscr...@flink.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to