Issue 7994 - [LMDB] Feature Request: Access to current transaction ID.
Summary: [LMDB] Feature Request: Access to current transaction ID.
Status: VERIFIED FIXED
Alias: None
Product: LMDB
Classification: Unclassified
Component: liblmdb (show other issues)
Version: unspecified
Hardware: All All
: --- normal
Target Milestone: ---
Assignee: OpenLDAP project
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-12-05 17:52 UTC by dmbarbour@gmail.com
Modified: 2020-03-12 15:55 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 dmbarbour@gmail.com 2014-12-05 17:52:26 UTC
Full_Name: David Barbour
Version: LMDB 0.9.10
OS: Ubuntu
URL: ftp://ftp.openldap.org/incoming/
Submission from: (NULL) (2602:306:80bb:160:d913:da7:da0f:76b3)


As discussed on the list [1], I believe access to the current transaction ID
could be very useful for layering features above LMDB, such as concurrent
writers, read-only to read-write promotion, or serving as an e-tag for polling.

A patch David-Barbour-141205.patch has been uploaded and includes a disclaimer
to public-domain.

[1] http://www.openldap.org/lists/openldap-devel/201412/msg00000.html
Comment 1 Howard Chu 2014-12-05 17:58:48 UTC
dmbarbour@gmail.com wrote:
> Full_Name: David Barbour
> Version: LMDB 0.9.10
> OS: Ubuntu
> URL: ftp://ftp.openldap.org/incoming/
> Submission from: (NULL) (2602:306:80bb:160:d913:da7:da0f:76b3)
>
>
> As discussed on the list [1], I believe access to the current transaction ID
> could be very useful for layering features above LMDB, such as concurrent
> writers, read-only to read-write promotion, or serving as an e-tag for polling.
>
> A patch David-Barbour-141205.patch has been uploaded and includes a disclaimer
> to public-domain.
>
> [1] http://www.openldap.org/lists/openldap-devel/201412/msg00000.html
>
>
Thanks. There's a slight problem with the patch, your function returns 
MDB_txnid_t but that is a private typedef in mdb.c. It is not defined in 
lmdb.h, so no one will be able to compile and use this code.

Easiest change would be to just return size_t, like MDB_envinfo uses.

-- 
   -- 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 2 dmbarbour@gmail.com 2014-12-05 18:02:51 UTC
I typedef'd MDB_txnid_t at the top of lmdb.h. The patch also tweaks
MDB_envinfo.

On Fri, Dec 5, 2014 at 11:58 AM, Howard Chu <hyc@symas.com> wrote:
>
> Thanks. There's a slight problem with the patch, your function returns
> MDB_txnid_t but that is a private typedef in mdb.c. It is not defined in
> lmdb.h, so no one will be able to compile and use this code.
>
> Easiest change would be to just return size_t, like MDB_envinfo uses.
>
Comment 3 OpenLDAP project 2014-12-05 19:19:05 UTC
added to mdb.master
Comment 4 Howard Chu 2014-12-05 19:19:05 UTC
changed notes
changed state Open to Test
moved from Incoming to Software Enhancements
Comment 5 Quanah Gibson-Mount 2015-11-30 18:32:43 UTC
changed state Test to Closed