[Date Prev][Date Next]
Re: Question regarding MDB_NOLOCK
- To: David Barbour <email@example.com>
- Subject: Re: Question regarding MDB_NOLOCK
- From: Hallvard Breien Furuseth <firstname.lastname@example.org>
- Date: Sat, 31 Jan 2015 05:04:04 +0100
- Cc: Howard Chu <email@example.com>, OpenLDAP Devel <firstname.lastname@example.org>
- In-reply-to: <CAAOQMSt2M0XDW=BrNdcSiEgGV4xGDJWZxSh_5QJW6HS7jNYEBg@mail.gmail.com>
- References: <CAAOQMSvoHLLH==PgjiQ_RQvfWQ265MCFC3SU2x+FQEcm8fWTQg@mail.gmail.com> <547C654E.email@example.com> <CAAOQMSt2M0XDW=BrNdcSiEgGV4xGDJWZxSh_5QJW6HS7jNYEBg@mail.gmail.com>
- User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0
On 30/01/15 22:57, David Barbour wrote:
On Mon, Dec 1, 2014 at 6:55 AM, Hallvard Breien Furuseth
<firstname.lastname@example.org <mailto:email@example.com>> wrote:
Last snapshot is never overwritten. So readers which did begin/renew
after latest commit(write txn) are safe from txn_begin(write txn).
The same with the commit of the write txn before that. I think.
MDB keeps the last two snapshots in the metapages.
> I've been reading the MDB source code a bit more to verify this
assumption. It is not valid.
MDB does keep the last two metapages, but may begin to dismantle the
elder of the two for pages if there are no readers for it.
Yes, true. The last two snapshots' *data pages* are never
overwritten, and any readers using them will have read the
metapage and do not need it again.
I confused myself because I was thinking of sync issues:
Even if the oldest metapage has been overwritten, that
does not mean it is gone yet: If it has not been synced
to disk, a system crash can bring it back. And with it,
its refs to datapages.
Looking closer though, that's only relevant if with
MDB_NOSYNC, where the previous metapage has not been