This is an automated email from the ASF dual-hosted git repository.

RocMarshal pushed a commit to branch release-2.3
in repository https://gitbox.apache.org/repos/asf/flink.git

commit 523a4abf6563cf38435e6c82f334411a79621fb6
Author: Mohsen Rezaei <[email protected]>
AuthorDate: Tue Oct 13 11:23:38 2026 -0700

    implemented ForStFlinkFileSystem's rename API for created dirs
    
    (cherry picked from commit d767b7c8a57e230781fe0ab645825236ce5e85e6)
---
 .../fs/ForStFileSystemTrackingCreatedDirDecorator.java   | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git 
a/flink-state-backends/flink-statebackend-forst/src/main/java/org/apache/flink/state/forst/fs/ForStFileSystemTrackingCreatedDirDecorator.java
 
b/flink-state-backends/flink-statebackend-forst/src/main/java/org/apache/flink/state/forst/fs/ForStFileSystemTrackingCreatedDirDecorator.java
index 7d7ba568b2d..5f205561f4b 100644
--- 
a/flink-state-backends/flink-statebackend-forst/src/main/java/org/apache/flink/state/forst/fs/ForStFileSystemTrackingCreatedDirDecorator.java
+++ 
b/flink-state-backends/flink-statebackend-forst/src/main/java/org/apache/flink/state/forst/fs/ForStFileSystemTrackingCreatedDirDecorator.java
@@ -56,4 +56,20 @@ public class ForStFileSystemTrackingCreatedDirDecorator 
extends ForStFlinkFileSy
         }
         return super.exists(f);
     }
+
+    /**
+     * Renaming a tracked directory moves its tracked existence to the 
destination. A directory
+     * rename recreates the destination through the undecorated file system, 
where mkdir() has no
+     * effect, so without this the destination is reported as missing. RocksDB 
relies on it when it
+     * renames the export directory into place while restoring at a lower 
parallelism with ingest-DB
+     * restore mode.
+     */
+    @Override
+    public synchronized boolean rename(Path src, Path dst) throws IOException {
+        boolean renamed = super.rename(src, dst);
+        if (renamed && createdDirPaths.remove(src)) {
+            createdDirPaths.add(dst);
+        }
+        return renamed;
+    }
 }

Reply via email to