| From: | Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp> | 
|---|---|
| To: | masao(dot)fujii(at)gmail(dot)com | 
| Cc: | sawada(dot)mshk(at)gmail(dot)com, thomas(dot)munro(at)enterprisedb(dot)com, michael(dot)paquier(at)gmail(dot)com, robertmhaas(at)gmail(dot)com, thom(at)linux(dot)com, memissemerson(at)gmail(dot)com, josh(at)agliodbs(dot)com, amit(dot)kapila16(at)gmail(dot)com, pgsql-hackers(at)postgresql(dot)org | 
| Subject: | Re: Support for N synchronous standby servers - take 2 | 
| Date: | 2016-04-06 05:18:44 | 
| Message-ID: | 20160406.141844.70860176.horiguchi.kyotaro@lab.ntt.co.jp | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-hackers | 
At Tue, 5 Apr 2016 20:17:21 +0900, Fujii Masao <masao(dot)fujii(at)gmail(dot)com> wrote in <CAHGQGwE8_F79BUpC5TmJ7aazXU=Uju0VznFCCKDK57-wNpHV-g(at)mail(dot)gmail(dot)com>
> >> list_member_int() performs the loop internally. So I'm not sure how much
> >> adding extra list_member_int() here can optimize this processing.
> >> Another idea is to make SyncRepGetSyncStandby() check whether I'm sync
> >> standby or not. In this idea, without adding extra loop, we can exit earilier
> >> in the case where I'm not a sync standby. Does this make sense?
> >
> > The list_member_int() is also performed in the "(snip)" part. So
> > SyncRepGetSyncStandbys() returning am_sync seems making sense.
> >
> > sync_standbys = SyncRepGetSyncStandbys(am_sync);
> >
> > /*
> >  *  Quick exit if I am not synchronous or there's not
> >  *  enough synchronous standbys
> >  * /
> > if (!*am_sync || list_length(sync_standbys) < SyncRepConfig->num_sync)
> > {
> >   list_free(sync_standbys);
> >   return false;
> > }
> 
> Thanks for the comment! I changed SyncRepGetSyncStandbys() so that
> it checks whether we're managing a sync standby or not.
> Attached is the updated version of the patch. I also applied several
> review comments to the patch.
It still does list_member_int but it can be gotten rid of as the
attached patch.
regards,
| Attachment | Content-Type | Size | 
|---|---|---|
| multi_sync_replication_v23_list_member_int.diff | text/x-patch | 1.5 KB | 
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Fujii Masao | 2016-04-06 05:21:03 | Re: Support for N synchronous standby servers - take 2 | 
| Previous Message | Noah Misch | 2016-04-06 05:14:34 | Re: Odd system-column handling in postgres_fdw join pushdown patch |