To circumvent the issue with stalled connections I've written a script, that resets the 'stalled' status with a sql query, initiated by a cronjob:

#!/bin/bash

NEEDS_RESTART=`psql -qAt -U postgres -d bucardo -c "select count(*) from bucardo.sync where status='stalled'"`;

if [ ! -e $BUCARDO_RESTART_LOG ] ;
then
        touch $BUCARDO_RESTART_LOG;
fi

if [ "$NEEDS_RESTART" != "0" ] ;
then
        `psql -qAt -U postgres -d bucardo -c "update bucardo.sync set status = 'inactive' where status='stalled'"`;

        bucardo deactivate all
        bucardo restart

fi

We set 'deactivate all' since here, except the main database (master) all other masters are most of the time offline and initiate the sync by themselves on demand with a local application.

Cheers,
Frank.

----- Nachricht von Michelle Sullivan <[email protected]> ---------
  Datum: Thu, 22 Jul 2021 06:51:10 +1000
    Von: Michelle Sullivan <[email protected]>
Betreff: Re: [Bucardo-general] cannot restart stalled sync
     An: Videanu Adrian <[email protected]>
     Cc: [email protected]

Just so you know I have to reset the column in the sync table as well... been doing it for years, it’s not a problem to do it as far as I can see.

  Michelle Sullivan      http://www.mhix.org/
   Hallowed are those that walk in unison.


On 22 Jul 2021, at 02:03, Videanu Adrian <[email protected]> wrote:
 

Hi all,
       
I`m running a 4 nodes master-master cluster with bucardo 5.4.1. Each node is in a different geographical region. Last night I had some problems with the internet in one of the locations and the replication was stopped.
       
The problem is that when the internet was back the majority of the syncs were stalled.
       I have tried the classical
        
       stop bucardo
       deactivate sync X
       activate sync X
       validate sync X
       start bucardo
        
but it seems to have no effect, these are still stalled even If when I validate the syncs I receive the [OK] message.
        
In order to work, I had to manually edit the syncs table from the bucardo database and update stalled with active.

       
I`m afraid that by doing this I`ll break something internally in bucardo.
       
      Any idea why it may behave like this?
                      
        Regards,
        Adrian Videanu
        Skype: videanu.adrian
        Tel:+40723864025

_______________________________________________
Bucardo-general mailing list
[email protected]
https://bucardo.org/mailman/listinfo/bucardo-general

----- Ende der Nachricht von Michelle Sullivan <[email protected]> -----
_______________________________________________
Bucardo-general mailing list
[email protected]
https://bucardo.org/mailman/listinfo/bucardo-general

Reply via email to