datalevin

Jon Hancock 2026-03-24T02:13:18.944869Z

Using the latest datalevin 0.10.7 and occasionally get a corrupted database: ; Execution error (ExceptionInfo) at datalevin.txlog/decode-header-buffer (txlog.clj:580). ; Invalid txn-log record magic This happens when I start/connect: (defn start! [] (locking conn* (if @conn* :already-running (let [c (d/get-conn (ensure-db-dir!) (schema/schema))] (reset! conn* c) :started)))) I used datalevin 0.9.22 on a prior project and never had corruption problems. One suspicion is that sometimes my AI agent (codex) will call db/start! through the nrepl. I see the corruption error when I run a jvm though calva and start! the connection. I have tried to isolate this to see if maybe it has to do with multiple jvms attempting to open the same db files...still unsure. Here is a github report https://github.com/datalevin/datalevin/issues/361 Any advice appreciated. thanks, Jon

Jon Hancock 2026-04-08T04:14:41.515079Z

@huahaiy This fix is working well. Can you please put this in a release? I am having to do some odd things with my container builds to get a local clone of datalevin compiled in my container for my deploy.

Huahai 2026-04-08T05:19:26.682639Z

Will do a release soon. Needs to tie some loose ends.

👍 1
Huahai 2026-03-24T15:49:48.038199Z

Thank you for the report. I am investigating.

Huahai 2026-03-24T16:01:53.042379Z

Multiple JVMs is definitely a use case that I have not thought about. Let me think this through and address this.

Huahai 2026-03-24T18:11:09.412989Z

Instead of fail fast at second writer, I will enable multi-process writers instead.

Huahai 2026-03-24T21:29:07.785959Z

master branch has this change. Please see if it works for you.

❤️ 2
Jon Hancock 2026-03-25T03:22:54.041809Z

thanks. I'll test and get back to you. For an embedded db I don't expect multi writer to be a valid use case. I just don't want an attempt to do so to corrupt the db.

Jon Hancock 2026-03-30T01:32:29.657199Z

@huahaiy I have been testing my app with the master branch build of datalevin. No corruption errors. The app will be getting more thorough pre-production testing the next two weeks.

👍 1