Issue 8191 - mdb_txn_commit(empty txn) does not sync
Summary: mdb_txn_commit(empty txn) does not sync
Status: VERIFIED FEEDBACK
Alias: None
Product: OpenLDAP
Classification: Unclassified
Component: slapd (show other issues)
Version: unspecified
Hardware: All All
: --- normal
Target Milestone: ---
Assignee: OpenLDAP project
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-07-07 19:44 UTC by Hallvard Furuseth
Modified: 2021-08-03 18:13 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Hallvard Furuseth 2015-07-07 19:44:30 UTC
Full_Name: Hallvard B Furuseth
Version: LMDB_0.9.15
OS: 
URL: 
Submission from: (NULL) (81.191.45.5)
Submitted by: hallvard


mdb_txn_commit(txn which made no changes) does not mdb_env_sync(),
but lmdb.h says several times that Commit flushes buffers to disk.


My feeling is that this is a quirk the user should not need to
know about, and it's cleaner to sy r rather than to document it.

OTOH I don't know if "fast commit of no-change txns" is a feature
which someone expects to work, and if sync can be expensive even
when there is no new data to flush. (I don't know what BDB does.)
Comment 1 Hallvard Furuseth 2015-07-07 19:51:53 UTC
On 07/07/15 21:44, h.b.furuseth@usit.uio.no wrote:
> My feeling is that this is a quirk the user should not need to
> know about, and it's cleaner to sy r rather than to document it.

...cleaner to sync rather than...


Comment 2 Howard Chu 2015-10-25 09:31:19 UTC
h.b.furuseth@usit.uio.no wrote:
> On 07/07/15 21:44, h.b.furuseth@usit.uio.no wrote:
>> My feeling is that this is a quirk the user should not need to
>> know about, and it's cleaner to sy r rather than to document it.
>
> ...cleaner to sync rather than...

The doc should say that committing an empty txn is a no-op. If you want to do 
a sync without writing data, use mdb_env_sync() yourself.

-- 
   -- Howard Chu
   CTO, Symas Corp.           http://www.symas.com
   Director, Highland Sun     http://highlandsun.com/hyc/
   Chief Architect, OpenLDAP  http://www.openldap.org/project/

Comment 3 Howard Chu 2015-10-25 09:31:42 UTC
changed state Open to Feedback