Pierre Chapuis wrote:
I am having a hard time understanding how exactly mdb_env_sync should be used. Suppose I have an environment with MDB_NOSYNC and I do not use MDB_WRITEMAP. I still want to sync at some points, which is why mdb_env_sync exists. But I wonder:
- How does it interact with transactions? Is it safe (or necessary) to call it outside of a transaction? During a read-only transaction? During a write transaction?
Since mdb_env_sync() doesn't take a txn as a parameter, it is impossible to call it inside of a transaction.
- What about thread safety? Can it be called concurrently with writes? Can it be called concurrently with another mdb_env_sync in another thread?
Try it and see.