datahike

2026-01-19T16:46:17.070819Z

hi! I encountered some floating bug(?). From time to time in my tests it fails with "not found user" or some another entity. Backend: memory. Context: it happen when soon (around ~10ms) after merge! database branch to trunk I do branch! and later lookup something. Looks like sometimes not all data from merged branch exist in new forked one. Is there some asynchronous background mechanics involved? Or something else could be a culprit. It happens relatively rare: in my test-suit 911 times merging/forking happen, it fails maybe around one of five suit runs. Datahike version is the recent one.

whilo 2026-01-19T20:02:59.474579Z

I need to route the versioning API through the transactor proper, it predates this and I think this is why sometimes it can fail. I hope to get to this in the next days. I worked through all other bindings and the pod first, but the versioning API is next on my agenda, in particular a standardization between proximum, datahike, git, zfs etc. such that you can snapshot larger systems consistently with the same API. Feedback for what you would like to have is helpful at the current point.

👍 1
2026-01-19T20:15:25.830369Z

My current need is to isolate database from main one for request process. Fork at the beginning and merge at the end. To keep whole the flow as function of request input and database state on the moment of input. As applied thing I want incapsulated merge! function that automatically (and maybe somehow optimized!) calculate diffs

2026-01-19T17:10:26.403649Z

And one more question. About tiered storage. Write is happen to both frontend and backend, okay. But is write to backend asynchronous or not? It would be nice in my case to write sync to LMDB and async to cloud CockroachDB (jdbc postgres) for long time persistance/backups/etc (not to wait every transaction for network overhead)...

2026-01-20T11:44:45.493299Z

Thank you!

whilo 2026-01-19T20:04:18.567059Z

You can do this, I think, but there might be a modification to the tiered store needed. I can take a look in a bit. It should not be hard to understand the tiered store code though and maybe you could use it to think through the memory model you would like to have (it literally just calls frontend and backend konserve stores, so not very heavy).

2026-01-19T20:06:47.081789Z

Hm.. i will take a look!

whilo 2026-01-19T20:08:35.361499Z

These are the different strategies, but it really depends on what your memory model and assumptions are: https://github.com/replikativ/konserve/blob/main/src/konserve/tiered.cljc#L244

👀 1
2026-01-19T20:58:54.016739Z

Ha. looks like there no strategy I want. Maybe it is against some consistency rules? I need synchronous write to frontend to work with this data immidialtely, but async in background to backend to store data more durable

whilo 2026-01-19T21:02:01.652579Z

No, describe what you want. These were just some defaults to give people options. konserve does not enforce complicated consistencies, the goal is rather to make it easy to build different data solutions on top. For instance datahike/pss ensure that the writes are consistent and properly done, not konserve. It just makes sure that individual values you write to it are properly handled. Having said that being consistent when writing can be tricky. If you write async in your groundtruth storage (cockroachdb) and it fails you might have read values from your frontend that are not consistent. But there are many workloads where this can be acceptable to reduce latency.

2026-01-19T21:21:02.140209Z

Like this

{:write-backuped
   (let [frontend-result (<?- (-assoc-in frontend-store key-vec meta-up-fn val opts))]
     (go (try
           (<?- (-assoc-in backend-store key-vec meta-up-fn val opts))
           (catch #?(:clj Exception :cljs js/Error) e
             (warn "Backend assoc failed in write-backuped" {:key key-vec :error e}))))
     frontend-result)}

whilo 2026-01-19T22:57:51.977829Z

In 0.9.344 :write-behind should now do what you want.

2026-01-19T18:58:32.341069Z

Function database-exists? in new version hangs up forever without any output on invalid config

whilo 2026-01-19T20:01:17.021859Z

Yes, I also just ran into this; investigating.

👍 1
whilo 2026-01-19T20:18:52.344799Z

Which DB backend was this with?

2026-01-19T20:24:02.106319Z

I tried on :memory and :jdbc . Both of them hang

whilo 2026-01-19T20:24:11.518279Z

Thx

whilo 2026-01-19T20:24:38.897269Z

Did your store config have the :id with a UUID set?

2026-01-19T20:30:21.295179Z

When I put it correctly it works fine. But if something wrong - it hangs

whilo 2026-01-19T20:30:39.252139Z

Yes, found the issue, validating the fix.

2026-01-19T20:31:21.281829Z

In 0.6.* version it threw exception like connect, but in 0.7.* no

whilo 2026-01-21T09:42:11.180509Z

Should be fixed in the latest release now thanks to @uppfinnarjonas.

👍 1