Comments (2)
The DB file looks corrupted. We could put in a JVM shutdown hook to close DB, but it won't help if the machine is shutdown or the process is killed unexpectedly. So, 0.9.0 will default to the safe write mode to prevent this from happening. We will also add a JVM shutdown hook in the next release to reduce the chance.
from datalevin.
In the meantime I believe you can turn on safe write mode for your application by passing :flags
as [:nordahead :writemap :notls]
(note: this will mean sync flushes to disk, so no concurrent inserts/updates):
(defonce !conn
(d/get-conn "db" schema
{:kv-opts {:flags [:nordahead :writemap :notls]}}))
The default flags are:
datalevin/src/datalevin/constants.cljc
Line 45 in f7b10d4
The best documentation I have found on these flags is here:
I believe it's :mapasync
that can cause database corruption on crash.
/**
* Use asynchronous msync when {@link #MDB_WRITEMAP} is used.
*
* <p>
* When using {@link #MDB_WRITEMAP}, use asynchronous flushes to disk.
* As with {@link #MDB_NOSYNC}, a system crash can then corrupt the database
* or lose the last transactions. Calling {@link Env#sync(boolean)} ensures
* on-disk database integrity until next commit.
*/
MDB_MAPASYNC(0x10_0000),
Hope that helps.
from datalevin.
Related Issues (20)
- deal with client calls when server search engine is timed out
- Datalevin doesn't play well with sci (through malli) HOT 6
- value unification in function expression result
- [QUESTION]: separate the client into a small lib? HOT 23
- Allow indexing of arbitrary data
- Bump taoensso/encore is breaking datalevin HOT 4
- Options not recovered after automatic reconnection HOT 2
- Return maps
- Staged entity transactions broken for refs HOT 2
- Contribution Instructions out of date? HOT 3
- TTL for key-value store
- Materialized views
- orm.lmdbjava.Dbi$MapResizedException on query after reimport 0.8.16 → 0.9.5 HOT 1
- Hard fail when upgrading to 0.9.0 from 0.8.29 HOT 6
- Port Jepsen Test for Datomic
- Use CVM algorithm for faster cardinality estimation
- Micro batch transaction mode
- CSV data import HOT 1
- Query functions similar to LIKE and IN operators in SQL
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from datalevin.