[Date Prev][Date Next]
[Chronological]
[Thread]
[Top]
Re: After power reset, LMDB sub-DBs' key-pairs are missing
- To: Howard Chu <hyc@symas.com>
- Subject: Re: After power reset, LMDB sub-DBs' key-pairs are missing
- From: Arto Bendiken <arto@bendiken.net>
- Date: Mon, 14 Mar 2016 19:32:05 +0100
- Cc: LMDB mailing list <openldap-technical@openldap.org>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bendiken-net.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=TQ6F8hl8+kQGrTHjRx4LOIwkeSxlJUnUIpBEIKKMSmM=; b=ZpijfxYVe99hy1ga5H/4h/8eVpTl/Nre0Y4/X0TLL3RS1dZwOGRn8iCTqUKIqleUVm 1r0ccsbFcjVgXzaJqVcEUlGwvYhhEBxN7Gc6mJOd8IYLEbe8xuRAVl6CB5HnQCVNNvgL 1+udfkblB5gT1N0Eo31iMejQXvKteNAkx2hakV3HYwnRGM/CWyLBm9F08s//Yqz4JGFq hwP3x26yBOCPxdeoj9ALActJUJhnuSaaFdvQuedDoZBIZDa5IY3bbBadnvuiAVdNF7X+ ovbXS6r5DmAUfxt9vNIbwX7z9hpgHqfSX1NoN4ZIBexyuo0NM6MBw3QfuoxYirQ8MfLF 8zXA==
- In-reply-to: <56E701F4.8010702@symas.com>
- References: <CAE7aNuS4=5ENrgL7w=zDqUe2dE7WH01nkAkAX76Msuw_uj=xug@mail.gmail.com> <56E6F07B.2040307@symas.com> <CAE7aNuRGhyz51gV7uTfNuFFUCX2-cSyaVKFBaZmNqfGusPNHMw@mail.gmail.com> <56E701F4.8010702@symas.com>
Hi Howard,
On Mon, Mar 14, 2016 at 7:24 PM, Howard Chu <hyc@symas.com> wrote:
> Arto Bendiken wrote:
>>
>> As for the present problem, from further analysis what I suspect to be
>> the reason those sub-DBs each contain their lone keys is that those
>> three keys (one in each sub-DB) are the defaults inserted when the
>> program initializes a new LMDB file to write to. Those three keys are
>> inserted if the database is believed to be empty, i.e., if it has zero
>> entries.
>>
>> So possibly the post-reboot state of the DB file looked empty to LMDB,
>> either for the main DB or for the three sub-DBs, and the program then
>> proceeded to insert and commit those default keys. That's more
>> plausible than a resurrection of the exact initial state (from months
>> ago) where the original pages would indeed be long gone, as you noted.
>>
>> I don't suppose there is much hope of finding the previous B+tree
>> root(s) in the .mdb file and attempting to recover data from any
>> still-reachable leaves?
>
>
> If as you suspect, these 3 entries are present because they were
> automatically reinserted, then no, you're not likely to be able to recover
> anything. If the DB file had not been modified from it's actual crashed
> state, it would have been possible to access the previous transaction's meta
> page which would very likely have pointed to complete intact data. But when
> you wrote to the DB, you overwrote the previous meta page.
Thanks for confirming, I suspected as much. Bummer. I'll go ahead and
proceed with restoring backups in this case, and will review the
program logic to be more cautious in re-initializing what looks like
(based on file size, last transaction ID, or other heuristics) a
potentially-recoverable .mdb file instead of a genuinely new and empty
one.
Thanks for you help,
Arto
--
Arto Bendiken | @bendiken | http://ar.to