Re: Support for N synchronous standby servers - take 2 - Mailing list pgsql-hackers

From Kyotaro HORIGUCHI
Subject Re: Support for N synchronous standby servers - take 2
Date
Msg-id 20160406.170151.246853881.horiguchi.kyotaro@lab.ntt.co.jp
Whole thread Raw
In response to Re: Support for N synchronous standby servers - take 2  (Fujii Masao <masao.fujii@gmail.com>)
Responses Re: Support for N synchronous standby servers - take 2
Re: Support for N synchronous standby servers - take 2
List pgsql-hackers
At Wed, 6 Apr 2016 15:29:12 +0900, Fujii Masao <masao.fujii@gmail.com> wrote in
<CAHGQGwHGQEwH2c9buiZ=G7Ko8PQYwiU7=NsDkvCjRKUPSN8j7A@mail.gmail.com>
> > @@ -640,6 +639,13 @@ SyncRepGetSyncStandbys(bool *am_sync)
> >         }
> >
> >         /*
> > +        * The pending list contains eventually potentially-synchronized standbys
> > +        * and this walsender may be one of them. So once reset am_sync.
> > +        */
> > +       if (am_sync != NULL)
> > +               *am_sync = false;
> > +
> > +       /*
> 
> This code seems wrong in the case where this walsender is in the result list.
> So I adopted another logic. Attached is the updated version of the patch.

You must misread the patch. am_sync is originally set in the loop
just after that for the case.

!     while (priority <= lowest_priority)
!     {
..
!         for (cell = list_head(pending); cell != NULL; cell = next)
!         {
...
!             if (this_priority == priority)
!             {
!                 result = lappend_int(result, i);
!                 if (am_sync != NULL && walsnd == MyWalSnd)
!                     *am_sync = true;

-- 
Kyotaro Horiguchi
NTT Open Source Software Center





pgsql-hackers by date:

Previous
From: Asif Naeem
Date:
Subject: Re: Truncating/vacuuming relations on full tablespaces
Next
From: Michael Paquier
Date:
Subject: Re: Support for N synchronous standby servers - take 2