[Dovecot] Dovecot pgsqlauthentication database reconnection/failover problem
Hi,
Our mail system uses dovecot-1.0-1.2.rc15.el5 in Centos-5.1 as our imap
server. It connects to a pgsql database in another server as authentication
backend. It works fine except occasionally fails to reconnect to the database
after temporary network block, and dovecot has to be restarted to work again
in such case. Since I can't find any specific setting in dovecot.conf to
handle this reconnection problem, I opt to build a failover pgsql backend.
Google led me to
http://www.dovecot.org/list/dovecot/2008-January/027899.html. I followed the
thread to modify my dovecot-sql.conf containing "connect = host=pgsql1
host=pgsql2 dbname=xxxx user=xxxx"
If both databases are available, dovecot will choose pgsql2 as the default
one, and user login works flawlessly. But when I block all traffic to host
pgsql2, dovecot will repeatedly try pgsql2 and neglect available host pgsql1.
I don't find relevent information in the dovecot wiki either. Can anyone
here shed a light on me?
Thanks in advance!
Regards, Frank Wang
On Sat, 2008-02-16 at 21:46 +0800, Frank Wang wrote:
Hi, Our mail system uses dovecot-1.0-1.2.rc15.el5 in Centos-5.1 as our imap server. It connects to a pgsql database in another server as authentication backend. It works fine except occasionally fails to reconnect to the database after temporary network block, and dovecot has to be restarted to work again in such case.
It's most likely fixed in newer versions. For example there is one PostgreSQL fix in v1.0.4 and another in v1.0.rc26. There may be other fixes as well.
You can find newer Dovecot RPMs for CentOS 5 from atrpms.net.
Google led me to
http://www.dovecot.org/list/dovecot/2008-January/027899.html. I followed the thread to modify my dovecot-sql.conf containing "connect = host=pgsql1 host=pgsql2 dbname=xxxx user=xxxx"
Currently this works only with MySQL.
On Sat, 2008-02-16 at 21:46 +0800, Frank Wang wrote:
Hi, Our mail system uses dovecot-1.0-1.2.rc15.el5 in Centos-5.1 as our imap server. It connects to a pgsql database in another server as authentication backend. It works fine except occasionally fails to reconnect to the database after temporary network block, and dovecot has to be restarted to work again in such case.
It's most likely fixed in newer versions. For example there is one PostgreSQL fix in v1.0.4 and another in v1.0.rc26. There may be other fixes as well.
You can find newer Dovecot RPMs for CentOS 5 from atrpms.net.
Thanks for the quick reply. I've tested the dovecot-1.0.10-0_66.el5 from atrpms.net. The reconnection problem hasn't occur during the test so far, good! I'll need sometime to test the stability though, as it's marked test in the repo.
Google led me to http://www.dovecot.org/list/dovecot/2008-January/027899.html. I followed the thread to modify my dovecot-sql.conf containing "connect = host=pgsql1 host=pgsql2 dbname=xxxx user=xxxx"
Currently this works only with MySQL. Is it possible to achieve similar failover using pgsql backend? As we had built other systems using the same pgsql database, migrate to mysql is not an option here.
Regards, Frank Wang
On Sun, 2008-02-17 at 00:03 +0800, Frank Wang wrote:
Google led me to http://www.dovecot.org/list/dovecot/2008-January/027899.html. I followed the thread to modify my dovecot-sql.conf containing "connect = host=pgsql1 host=pgsql2 dbname=xxxx user=xxxx"
Currently this works only with MySQL. Is it possible to achieve similar failover using pgsql backend?
It would require writing code to support that, but I'm not going to get around to it anytime soon. The MySQL-specific connection pooling code should probably be moved to generic code that works with all SQL backends.
Is it possible to achieve similar failover using pgsql backend?
It would require writing code to support that, but I'm not going to get around to it anytime soon. The MySQL-specific connection pooling code should probably be moved to generic code that works with all SQL backends.
Yeah, with generic pooling code, it'll definitely increase dovecot's availability for more situation. Thanks for your nice work!
Regards, Frank Wang
On Sun, Feb 17, 2008 at 12:03:53AM +0800, Frank Wang wrote:
On Sat, 2008-02-16 at 21:46 +0800, Frank Wang wrote: You can find newer Dovecot RPMs for CentOS 5 from atrpms.net.
Thanks for the quick reply. I've tested the dovecot-1.0.10-0_66.el5 from atrpms.net. The reconnection problem hasn't occur during the test so far, good! I'll need sometime to test the stability though, as it's marked test in the repo.
Everything that replaces a package in RHEL5/CentOS5 is in the testing repo and will never become stable.
E.g. just replace the "testing" label with "replaces vendor packages" in this case. Still you should give it a good test anyways.
Axel.Thimm at ATrpms.net
participants (3)
-
Axel Thimm
-
Frank Wang
-
Timo Sirainen