semlanghi opened a new issue, #1845:
URL: https://github.com/apache/fluss/issues/1845

   ### Search before asking
   
   - [x] I searched in the [issues](https://github.com/apache/fluss/issues) and 
found nothing similar.
   
   
   ### Fluss version
   
   0.7.0 (latest release)
   
   ### Please describe the bug 🐞
   
   In the class 
[`FlinkTableFactory`](https://github.com/apache/fluss/blob/main/fluss-flink/fluss-flink-common/src/main/java/org/apache/fluss/flink/catalog/FlinkTableFactory.java)
 there is an hard-coding of the `client.scanner.io.tmpdir` 
(`ConfigOptions.CLIENT_SCANNER_IO_TMP_DIR`) with the flink io tmp dir: 
   ``` 
   // pass flink io tmp dir to fluss client.
   flussConfig.setString(
   ConfigOptions.CLIENT_SCANNER_IO_TMP_DIR,
   new File(flinkConfig.get(CoreOptions.TMP_DIRS), "/fluss").getAbsolutePath());
   ```
   As a consequence, when the Flink cluster (or SQL Gateway) and the client run 
on different hosts, the client attempts to access a directory that may not 
exist (or to which it lacks privileges) on its own host, since the path 
references the Flink host’s temp directory.
   ```
   Caused by: java.io.IOException: Failed to create directory 
<flink_java_io_tmp_dir>/fluss/<snapshot-id> for storing kv snapshot files.
   ```
   
   ### Solution
   
   A possible solution to this problem would be to remove the lines 
https://github.com/apache/fluss/blob/6bdf031a094cd775fd2d9cb7dc3f1bcb80fdf15f/fluss-flink/fluss-flink-common/src/main/java/org/apache/fluss/flink/catalog/FlinkTableFactory.java#L237-L239
   
   as the `ConfigOptions.CLIENT_SCANNER_IO_TMP_DIR` already defaults to the 
local `java.tmp.dir`
   ```
   public static final ConfigOption<String> CLIENT_SCANNER_IO_TMP_DIR =
               key("client.scanner.io.tmpdir")
                       .stringType()
                       .defaultValue(System.getProperty("java.io.tmpdir") + 
"/fluss")
                       .withDescription(
                               "Local directory that is used by client for"
                                       + " storing the data files (like kv 
snapshot, log segment files) to read temporarily");
   ```
   
   ### Are you willing to submit a PR?
   
   - [x] I'm willing to submit a PR!


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