On Wed, Dec 24, 2025 at 08:33:33PM +0300, Michael Tokarev via Postfix-users 
wrote:

> On 12/24/25 17:47, Viktor Dukhovni via Postfix-users wrote:
> ..
> > but if a vendor does ship "btree" or "hash" drivers for Postfix, they
> > really should change the defaults.
> 
> I assume here Viktor meant "does NOT ship".

Correct, sorry about that.

> The prob is that with so long history of btree/hash, it isn't easy
> to switch away from it.  Changing defaults is trivial, but it isn't
> clear which new default to choose (perhaps lmdb),

My own choice for the default map type is frankly "cdb", but "lmdb" is
also a fine choice.  Very few indexed tables in Postfix need to support
incremental updates, which is why "cdb" is also a reasonable candidate.

> and the main prob is to convert existing maps from hash/btree to the
> new default during upgrades.

Yes, finding all the maps that need updates is difficult, and in general
requires manual user intervention (there may be upstream configuration
management systems that own main.cf, ...).  There is no fully automated
solution at package upgrade time.

> We had an unpleasant experience when BDB changed the format in an
> incompatible way, so all maps had to be rebuilt.  Without changing
> the config it was easier, but it already was difficult for the users,
> despite some attempts to automate it.
> 
> Now not only the maps has to be rebuilt, but also the config(s)
> has to be changed.

Well, one might ultimately add compatibility entries to "dynamicmaps.cf"
that remap "btree" and "hash" to the LMDB driver.  Which reduces the
need to change configs, but all the maps still need rebuilding, and
user managed Makefiles may need changes in suffix rules, ...

On Wed, Dec 24, 2025 at 11:35:11PM +0100, Geert Hendrickx via Postfix-users 
wrote:
> On Thu, Dec 25, 2025 at 01:47:30 +1100, Viktor Dukhovni via Postfix-users 
> wrote:
> > 
> > These are the upstream defaults,
> > 
> >     $ git grep -wB1 btree -- src/global/mail_params.h
> >     src/global/mail_params.h-#define VAR_VERIFY_MAP                 
> > "address_verify_map"
> >     src/global/mail_params.h:#define DEF_VERIFY_MAP                 
> > "btree:$data_directory/verify_cache"
> >     --
> >     src/global/mail_params.h-#define VAR_PSC_CACHE_MAP      
> > "postscreen_cache_map"
> >     src/global/mail_params.h:#define DEF_PSC_CACHE_MAP      
> > "btree:$data_directory/postscreen_cache"
> > 
> > but if a vendor does [NOT] ship "btree" or "hash" drivers for Postfix, they
> > really should change the defaults.
> 
> 
> They dropped libdb for RHEL 10, and at least intended to change the default 
> to lmdb:
> 
> https://src.fedoraproject.org/rpms/postfix/c/6a2621e4d73d59337dc64ba45922132286b841a1
> https://src.fedoraproject.org/rpms/postfix/c/7235852485bb4452cd2f909d5ff9cbb6c451e08f

That would have been the right time to change those two defaults.
Perhaps Postfix should have a visible "default_cache_type" parameter
(in addition to "default_database_type") so that a user or package
maintainer can set:

    default_database_type = cdb
    defaulet_cache_type = lmdb

while upstream Postfix might still have (for most/many platforms):

    default_database_type = hash
    defaulet_cache_type = btree

and the upstream compile-time defaults for the two caches would be:

> >     src/global/mail_params.h:#define DEF_VERIFY_MAP         
> > "${default_cache_type}:$data_directory/verify_cache"
> >     src/global/mail_params.h:#define DEF_PSC_CACHE_MAP      
> > "${default_cache_type}:$data_directory/postscreen_cache"

-- 
    Viktor.  🇺🇦 Слава Україні!
_______________________________________________
Postfix-users mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to