Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot start RocksDB XTDB nodes from multiple processes on Windows #12780

Closed
serioga opened this issue Jun 18, 2024 · 5 comments
Closed

Cannot start RocksDB XTDB nodes from multiple processes on Windows #12780

serioga opened this issue Jun 18, 2024 · 5 comments

Comments

@serioga
Copy link

serioga commented Jun 18, 2024

Expected behavior

Work on Windows simultaneously with multiple apps that use XTDB connection with RocksDB.

Actual behavior

Only first running instance can start XTDB node.
Other apps produce error:

Execution error at org.rocksdb.NativeLibraryLoader/loadLibraryFromJarToTemp (NativeLibraryLoader.java:142).
File: C:\Users\ST\AppData\Local\Temp\xtdb_rocksdb-6.12.7\librocksdbjni-win64.dll already exists and cannot be removed.

Steps to reproduce the behavior

Start XTDB node with RocksDB storage from different processes simultaneously.

@adamretter
Copy link
Collaborator

@serioga I think we need to eliminate any XTDB issues here really.

In your error above I see the number 6.12.7 but it also references line 142 of NativeLibraryLoader.java, however there is no such line in RocksDB 6.12.7, see: https://github.com/facebook/rocksdb/blob/v6.12.7/java/src/main/java/org/rocksdb/NativeLibraryLoader.java

What version of RocksDB are you using please?

@serioga
Copy link
Author

serioga commented Jun 19, 2024

What version of RocksDB are you using please?

com.xtdb/xtdb-rocksdb     {:mvn/version "1.24.3"}

which uses org.rocksdb/rocksdbjni:7.7.3 with lines in org.rocksdb.NativeLibraryLoader:

        if (temp.exists() && !temp.delete()) {
          throw new RuntimeException(
              "File: " + temp.getAbsolutePath() + " already exists and cannot be removed.");
        }

I have no idea where the xtdb_rocksdb-6.12.7 in the path comes from.

@jarohen
Copy link

jarohen commented Jun 19, 2024

@serioga, @adamretter thanks for looking into this 🙏

I believe we should be able to pass null to loadLibrary and get Rocks to manage the temp-dir for us - I'll investigate that and get back to you.

(xtdb/xtdb#3113 on our side)

@serioga
Copy link
Author

serioga commented Jun 19, 2024

I have no idea where the xtdb_rocksdb-6.12.7 in the path comes from.

Ah, this is from the xtdb.rocksdb.loader:

(defn- load-rocksdb-native-lib []
  (let [tmp (doto (io/file (System/getProperty "java.io.tmpdir") "xtdb_rocksdb-6.12.7") .mkdirs)
        library (io/file tmp (Environment/getJniLibraryFileName "rocksdb"))]
    (.loadLibrary (NativeLibraryLoader/getInstance) (str tmp))
    (str library)))

@refset
Copy link
Contributor

refset commented Jun 20, 2024

With today's minor release of XTDB 1.24.4 this issue can now be closed - thanks again for the report @serioga and apologies for the noise here 🙂

@ajkr ajkr closed this as not planned Won't fix, can't repro, duplicate, stale Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants