Fork me on GitHub
#xtdb
<
2020-09-14
>
shaunxcode20:09:45

I am looking for the simplest way to play with crux w/ persistence.

refset20:09:10

Hi, are you okay using Crux embedded in your application process? Or are you looking for Crux to act as a normal DB server?

shaunxcode20:09:24

embedded is fine

shaunxcode20:09:34

I'd like to avoid spinning up a rocksdb instance etc though (if thats what is best then so be it)

refset20:09:30

The "standalone" mode RocksDB configuration is definitely the simplest option. It's just a few short lines of config

refset20:09:51

We're releasing a new module config system in a couple of days, so the docs are a bit out of sync (showing the unreleased config - I only just noticed...), but the 1.11 version config here should work well for you: https://www.opencrux.com/reference/20.09-1.11.0/rocksdb.html#rocks-start

refset21:09:40

updating it for 1.12 in a couple of days will be painless, it just looks slightly different (and hopefully more obvious)

shaunxcode21:09:38

that sounds good! I am a longtime datomic user just trying to kick the tires on an alternative

👍 3
refset21:09:46

cool, please kick as hard as you like! All feedback is welcome 🙂

shaunxcode21:09:33

thanks that worked 🙂 (the rocks db example)

🚀 3
shaunxcode22:09:29

is there documentation for how (if?) refs works both for transacting and querying?

refset22:09:47

Do you mean refs as in "lookup refs"? We can't support that feature so directly as Crux doesn't track/enforce uniqueness. All attributes may be used as reference attributes, and the mapping between IDs and values is resolved at query time only

refset23:09:25

I should add: if you do really need some forms of uniqueness constraints you can build exactly the thing you need with transaction functions

shaunxcode19:09:51

yeah that is what I am doing for now and I think it is working!

shaunxcode19:09:14

I had a failed tx though and the next time I tried a tx I get RocksDBException "indexes/LOCK: No locks available"

shaunxcode19:09:28

I passed in a malformed tx previously

refset19:09:38

Hmm, did your node crash due to the failure and then you restarted it? Assuming Crux shuts down cleanly the LOCK file will get removed

refset20:09:50

I just tried kill -9 on a process running a RocksDB node and it recovered fine after restarting the REPL, without needing to manually remove the LOCK. Are you on Linux? Or Windows or OS/X?

shaunxcode20:09:25

OS X, once I restarted clj repl it was fine

👍 3
refset20:09:14

Interesting :thinking_face: I won't be able to reproduce it easily myself, but perhaps there's an obvious answer. We would like to have more reliable OS X development support soon, so if it happens again please do feel free to open an issue. And sorry for the inconvenience!