Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-6186

RocksDB based WindowStore fail to create db file on Windows OS

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • 1.0.0
    • None
    • streams
    • None
    • Windows OS

    Description

      Code snippet just like below

      ...
      textLines.flatMapValues(value -> Arrays.asList(pattern.split(value.toLowerCase()))).groupBy((key, word) -> word)
      .windowedBy(TimeWindows.of(10000)).count(Materialized.as("Counts"));
      ...

      Run it on Windows, then the exception is throw as below

      Caused by: org.rocksdb.RocksDBException: Failed to create dir: F:\tmp\kafka-streams\wordcount-lambda-example\1_0\Counts\Counts:1510099200000: Invalid argument
      at org.rocksdb.RocksDB.open(Native Method) ~[rocksdbjni-5.7.3.jar:na]
      at org.rocksdb.RocksDB.open(RocksDB.java:231) ~[rocksdbjni-5.7.3.jar:na]
      at org.apache.kafka.streams.state.internals.RocksDBStore.openDB(RocksDBStore.java:197) ~[kafka-streams-1.0.0.jar:na]
      ... 29 common frames omitted

      Checked the code, I found the issue is caused by line 72 in org.apache.kafka.streams.state.internals.Segments

      String segmentName(final long segmentId)

      { // previous format used - as a separator so if this changes in the future // then we should use something different. return name + ":" + segmentId * segmentInterval; }

      "segmentName" is passed to RocksDB, RockDB will use it as file name to create the DB file, as we known, the ":" cannot be part of file name in Windows OS.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              jms_wu Jianshao Wu
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: