[ 
https://issues.apache.org/jira/browse/FLINK-10918?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17036414#comment-17036414
 ] 

Stephan Ewen commented on FLINK-10918:
--------------------------------------

I think we need to re-boot this issue.

Looking at the code, the root cause seems to be the use of the Flink Path class 
for local directories, which not always handles the removal of leading slashes 
correctly.

I believe the best fix is to change the RocksDB Snapshot classes to use either 
{{File}} or {{java.io.file.Path}}. The reason being that Flink's Path class is 
the minimal "cross file system / object store" abstraction (local, hdfs, s3, 
etc.).

RocksDB is strictly tied to the local Unix/Windows file system, so it makes 
sense to build the classes with the local File or Path types.

> incremental Keyed state with RocksDB throws cannot create directory error in 
> windows
> ------------------------------------------------------------------------------------
>
>                 Key: FLINK-10918
>                 URL: https://issues.apache.org/jira/browse/FLINK-10918
>             Project: Flink
>          Issue Type: Bug
>          Components: Runtime / Queryable State, Runtime / State Backends
>    Affects Versions: 1.6.2, 1.9.2, 1.10.0
>         Environment: windows
> {code:java}
> val env = StreamExecutionEnvironment.getExecutionEnvironment
> val rocksdb = new RocksDBStateBackend("file:\\C:\\rocksdb\\checkpoint",true)
> rocksdb.setDbStoragePath("file:\\C:\\rocksdb\\storage")
> env.setStateBackend(rocksdb)
> env.enableCheckpointing(10)
> {code}
>  
>            Reporter: Amit
>            Priority: Major
>              Labels: usability
>         Attachments: 
> 0001-FLINK-10918-Fix-for-checkpoint-creation-on-windows-1.patch
>
>
> Facing error while enabling keyed state with RocksDBBackend with 
> checkpointing to a local windows directory
>  
> {code:java}
> Caused by: org.rocksdb.RocksDBException: Failed to create dir: 
> /c:/tmp/data/job_dbe01128760d4d5cb90809cd94c2a936_op_StreamMap_b5c8d46f3e7b141acf271f12622e752b__3_8__uuid_45c1f62b-a198-44f5-add5-7683079b03f8/chk-1.tmp:
>  Invalid argument
>                 at org.rocksdb.Checkpoint.createCheckpoint(Native Method)
>                 at org.rocksdb.Checkpoint.createCheckpoint(Checkpoint.java:51)
>                 at 
> org.apache.flink.contrib.streaming.state.RocksDBKeyedStateBackend$RocksDBIncrementalSnapshotOperation.takeSnapshot(RocksDBKeyedStateBackend.java:2549)
>                 at 
> org.apache.flink.contrib.streaming.state.RocksDBKeyedStateBackend$IncrementalSnapshotStrategy.performSnapshot(RocksDBKeyedStateBackend.java:2008)
>                 at 
> org.apache.flink.contrib.streaming.state.RocksDBKeyedStateBackend.snapshot(RocksDBKeyedStateBackend.java:498)
>                 at 
> org.apache.flink.streaming.api.operators.AbstractStreamOperator.snapshotState(AbstractStreamOperator.java:406)
>                 ... 13 more
> {code}
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to