<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
"http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title></title>
</head>
<body style="font-family:Arial;font-size:14px">
<p>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:<br>
<br>
#!/bin/bash<br>
<br>
NEEDS_RESTART=`psql -qAt -U postgres -d bucardo -c "select count(*) from bucardo.sync where status='stalled'"`;<br>
<br>
if [ ! -e $BUCARDO_RESTART_LOG ] ;<br>
then<br>
        touch $BUCARDO_RESTART_LOG;<br>
fi<br>
<br>
if [ "$NEEDS_RESTART" != "0" ] ;<br>
then<br>
        `psql -qAt -U postgres -d bucardo -c "update bucardo.sync set status = 'inactive' where status='stalled'"`;<br>
<br>
        bucardo deactivate all<br>
        bucardo restart<br>
<br>
fi<br>
<br>
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.<br>
<br>
Cheers,<br>
Frank.<br>
<br>
<br>
----- Nachricht von Michelle Sullivan <<a href="mailto:michelle@sorbs.net">michelle@sorbs.net</a>> ---------<br>
  Datum: Thu, 22 Jul 2021 06:51:10 +1000<br>
    Von: Michelle Sullivan <<a href="mailto:michelle@sorbs.net">michelle@sorbs.net</a>><br>
Betreff: Re: [Bucardo-general] cannot restart stalled sync<br>
     An: Videanu Adrian <<a href="mailto:videanuadrian@yahoo.com">videanuadrian@yahoo.com</a>><br>
     Cc: <a href="mailto:bucardo-general@bucardo.org">bucardo-general@bucardo.org</a></p>
<blockquote style="border-left:2px solid blue;margin-left:2px;padding-left:12px;" type="cite">
<p>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.<br>
<br></p>
<div dir="ltr" id="AppleMailSignature">Michelle Sullivan
<div><a href="http://www.mhix.org/">http://www.mhix.org/</a></div>
<div>Hallowed are those that walk in unison.</div>
</div>
<div dir="ltr"><br>
On 22 Jul 2021, at 02:03, Videanu Adrian <<a href="mailto:videanuadrian@yahoo.com">videanuadrian@yahoo.com</a>> wrote:<br>
 </div>
<blockquote type="cite">
<div dir="ltr">
<div class="ydp1c04199cyahoo-style-wrap" style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:13px;">
<div>
<div data-setdir="false" dir="ltr">Hi all,</div>
<div data-setdir="false" dir="ltr"> </div>
<div data-setdir="false" dir="ltr">I`m running a 4 nodes master-master cluster with bucardo 5.4.1. Each node is in a different geographical region.</div>
<div data-setdir="false" dir="ltr">Last night I had some problems with the internet in one of the locations and the replication was stopped.</div>
<div data-setdir="false" dir="ltr"> </div>
<div data-setdir="false" dir="ltr">The problem is that when the internet was back the majority of the syncs were stalled.<br>
<div>I have tried the classical</div>
<div data-setdir="false" dir="ltr"> </div>
<div data-setdir="false" dir="ltr">stop bucardo</div>
<div data-setdir="false" dir="ltr">deactivate sync X</div>
<div data-setdir="false" dir="ltr">activate sync X</div>
<div data-setdir="false" dir="ltr">validate sync X</div>
<div data-setdir="false" dir="ltr">start bucardo</div>
<div data-setdir="false" dir="ltr"> </div>
<div data-setdir="false" dir="ltr">but it seems to have no effect, these are still stalled even If when I validate the syncs I receive the [OK] message.</div>
<div data-setdir="false" dir="ltr"> </div>
<div data-setdir="false" dir="ltr">In order to work, I had to manually edit the syncs table from the bucardo database and update stalled with active.</div>
</div>
<div> </div>
<div data-setdir="false" dir="ltr">I`m afraid that by doing this I`ll break something internally in bucardo.</div>
<div data-setdir="false" dir="ltr"> </div>
<div data-setdir="false" dir="ltr">Any idea why it may behave like this?</div>
<div class="ydp1c04199csignature">
<div style="font-family:Helvetica, Arial, sans-serif;font-size:13px;">
<div> </div>
<div class="ydp744c546bsignature"><span>Regards,</span></div>
<div class="ydp744c546bsignature"><span>Adrian Videanu</span></div>
<div class="ydp744c546bsignature"><span><span>Skype: videanu.adrian</span></span></div>
<div><span><span>Tel:+40723864025</span></span></div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
<blockquote type="cite">
<div dir="ltr"><span>_______________________________________________</span><br>
<span>Bucardo-general mailing list</span><br>
<span><a href="mailto:Bucardo-general@bucardo.org">Bucardo-general@bucardo.org</a></span><br>
<span><a href="https://bucardo.org/mailman/listinfo/bucardo-general">https://bucardo.org/mailman/listinfo/bucardo-general</a></span></div>
</blockquote>
</blockquote>
<p><br>
<br>
<br>
----- Ende der Nachricht von Michelle Sullivan <<a href="mailto:michelle@sorbs.net">michelle@sorbs.net</a>> -----<br>
<br></p>
</body>
</html>