natan:
> W dniu 20.01.2023 o?15:04, Wietse Venema pisze:
> > natan:
> >> Hi
> >> I try to run "backup" transport maps like:
> >>
> >> smtpd_sender_login_maps =
> >> #first-main database
> >>      proxy:mysql:/etc/postfix/mysql_sender_login_maps.cf
> >> #second-backup
> >>      proxy:mysql:/etc/postfix/mysql_sender_login_maps-backup.cf
> >>
> >> Both databases are the same because they are synchronized (cluser
> >> gallera) but the first is in other machines and second in local
> >> (database ~150MB)
> >>
> >> I am thinking of such a solution as if there was a problem with the
> >> connection to the main database.
> >>
> >> does this solution make sense?
> > Postfix does not know that the two databases are identical, and
> > therefore it must assume that the databases can return different
> > results. When databases can produce different results, skipping
> > a database can produce an incorrect result.
> >
> > For correctness reasons, Postfix must stop when a database fails
> > to produce a result, and it must not skip to the next database.
> Right. That would make a double query like
> 1)cannot find user in first go to second

Yes. The first database produces a reply (not found).

> 2)cannot connect first go to second

No. Here the dtabase produces no reply, and Postfix cannot know
that the two databases are identical, therefore it must not skip
the non-responding database. 

That is the difference with a load balancer. A load balancer knows
that its backends provide an indentical service. If you need fast
fail over from one database mirror to another, use a load balancer.
I don't think that it would be a good idea to build a database load
balancer into Postfix.

        Wietse

Reply via email to