bucardo icon indicating copy to clipboard operation
bucardo copied to clipboard

Re Sync after lost DB Connection

Open ednt opened this issue 5 years ago • 4 comments

We try to run bucardo with 2 Postgres 11 servers in master <> master mode. We tested 5.5.0 (Debian buster package) and upgraded then (to test if the bug is still there) manually to 5.6.0

In general the sync works as expected.

But if we stop one of the postgres servers (postgres stop) bucardo show in Log "Warning: Killed (line 6511): DBD::Pg::db pg_notifies failed: SSL-Verbindung wurde un..." and Bucardo start to respawn.

If we bring up the server (postgres start) during the first 15 seconds everything works fine again.

If we bring up the server after the 15 seconds the log shows the reconnect, but sync is not working.

Sync start only after we apply "bucardo restart"

Is this a knwon bug and is there a workaround or patch ?

Btw. 'bucardo status' shows always 'Good' !!! And the sync is always 'active'.

ednt avatar Mar 10 '20 14:03 ednt

i have same problem please let me know if you find solution

walidelhawari avatar Jun 24 '20 10:06 walidelhawari

i have same problem too, in three master mode ,If any primary instance is stopped, all syncs will not work unless bucardo on any instance is restarted

xiaoluadr avatar Dec 19 '21 02:12 xiaoluadr

I have encountered the issue of Bucardo not re-connecting to the database after the connection has been lost for a period of time. Restarting Bucardo gets things going again. Currently leveraging Bucardo version 5.6.0.

Are there any additional configurations for Bucardo that would enable Bucardo to re-establish the database connections?

ken-harper avatar Feb 15 '22 20:02 ken-harper

Same problem here. What is happening is that when you stop the postgres service at server A, the replication processes at server B are finished, so no active sync is alive: Before stop of server A:

● bucardo.service - Start Bucardo
   Loaded: loaded (/etc/systemd/system/bucardo.service; enabled; vendor preset: disabled)
   Active: active (exited) since Mon 2022-03-14 01:30:23 UTC; 8s ago
  Process: 22 ExecStart=/usr/sbin/bucardo -h host.containers.internal start (code=exited, status=0/SUCCESS)
 Main PID: 22 (code=exited, status=0/SUCCESS)
   CGroup: /machine.slice/libpod-b474bc2b88479baec7917c66fa68c0c6fb11bf2e0f9062bda96852efbe909e9f.scope/system.slice/bucardo.service
           ├─24 Bucardo Master Control Program v5.6.0. Active syncs: sync_B_A
           ├─26 Bucardo VAC.                                                                                                                                                                                              
           ├─27 Bucardo Controller. Sync "sync_B_A" for relgroup "group_B_A" to dbs "sync_B_A"
           └─28 Bucardo Kid. Sync "sync_B_A"                                                                                                                                                                  

Mar 14 01:30:22 None systemd[1]: Starting Start Bucardo...
Mar 14 01:30:22 None bucardo[22]: Checking for existing processes
Mar 14 01:30:23 None bucardo[22]: Starting Bucardo
Mar 14 01:30:23 None systemd[1]: Started Start Bucardo.

After stop of server A:

● bucardo.service - Start Bucardo
   Loaded: loaded (/etc/systemd/system/bucardo.service; enabled; vendor preset: disabled)
   Active: active (exited) since Mon 2022-03-14 01:26:10 UTC; 3min 7s ago
  Process: 22 ExecStart=/usr/sbin/bucardo -h host.containers.internal start (code=exited, status=0/SUCCESS)
 Main PID: 22 (code=exited, status=0/SUCCESS)
   CGroup: /machine.slice/libpod-74981477f33b3943903cb7bfe23c9705419e55c0f5aeee412ed39e68ad4a31b0.scope/system.slice/
bucardo.service
           └─308 Bucardo Master Control Program v5.6.0. Active syncs:



Mar 14 01:26:10 None systemd[1]: Starting Start Bucardo...
Mar 14 01:26:10 None bucardo[22]: Checking for existing processes
Mar 14 01:26:10 None bucardo[22]: Starting Bucardo
Mar 14 01:26:10 None systemd[1]: Started Start Bucardo.

Looking for a solution...

ivarmu avatar Mar 14 '22 01:03 ivarmu