[pfx] Re: [heads up] lmdb 1.0
Edmund Lodewijks via Postfix-users <[email protected]> Sun, 5 Jul 2026 15:58:16 +0200
| Newsgroups | gmane.mail.postfix.user |
|---|---|
| Message-ID | <[email protected]> |
This is a multi-part message in MIME format.
--------------b4JZ40XQbsN09zh8vEgkSpQX
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
On 2026/07/05 13:19, Wietse Venema via Postfix-users wrote:
> Michael Grimm via Postfix-users:
>> Well, I will stick with lmdb 0.9.35 for the time being or migrate
>> to other database formats, instead.
>
> Way to go if you have that option.
I can see two ways to patch for this in Postfix:
1) Instead of dropping the table, walk a cursor and delete each record
in place. This is much more expensive than the current method, but I
think it the cost will still be negligible. The most expensive
transaction is when you run postmap/ postalias.
The nice thing about this is that it seems to me to be the least
invasive patch, with as little change as possible. Most of the current
structure stays the same. Importantly, atomicity is retained in the same
way that it currently exists. This is also compatible with lmdb 0.9.x.
An example patch is attached (not sure if the mailing list allows
attachments).
2) Alternatively, create a new table in a temp file + rename. There
would be more code involved for this, and a temp file (if you want to do
this securely, and not with a predictable name) introduces all kinds of
file permissions things to take care off across multiple OS's. This,
too, is compatible with lmdb 0.9.x.
I hope this is useful.
Kind regards,
Edmund
--
Edmund Lodewijks <[email protected]>
TZ: UTC+2 / GMT+2
--------------b4JZ40XQbsN09zh8vEgkSpQX
Content-Type: text/x-patch; charset=UTF-8; name="lmdb-1.0-bad-txn-fix.diff"
Content-Disposition: attachment; filename="lmdb-1.0-bad-txn-fix.diff"
Content-Transfer-Encoding: base64
ZGlmZiAtLWdpdCBhL3Bvc3RmaXgvc3JjL3V0aWwvc2xtZGIuYyBiL3Bvc3RmaXgvc3JjL3V0
aWwvc2xtZGIuYwppbmRleCAzZjc5NTYzMS4uNzliNWQ1YjUgMTAwNjQ0Ci0tLSBhL3Bvc3Rm
aXgvc3JjL3V0aWwvc2xtZGIuYworKysgYi9wb3N0Zml4L3NyYy91dGlsL3NsbWRiLmMKQEAg
L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zbG1kYi0+dHhuID0gMDsKIAkgICAg
cmV0dXJuIChzdGF0dXMpOwo=
--------------b4JZ40XQbsN09zh8vEgkSpQX
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
Postfix-users mailing list -- [email protected]
To unsubscribe send an email to [email protected]
--------------b4JZ40XQbsN09zh8vEgkSpQX--