Re: Quorum commit for multiple synchronous replication.

From: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
To: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Cc: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>, Noah Misch <noah(at)leadboat(dot)com>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Petr Jelinek <petr(at)2ndquadrant(dot)com>, Vik Fearing <vik(at)2ndquadrant(dot)fr>, Simon Riggs <simon(at)2ndquadrant(dot)com>, Josh Berkus <josh(at)agliodbs(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Quorum commit for multiple synchronous replication.
Date: 2017-04-14 01:47:46
Message-ID: CAD21AoD7Scnjrn5m+_eaDEsZnyXpbwGYw7x1sXeipAK=iqBKUQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Apr 14, 2017 at 9:38 AM, Michael Paquier
<michael(dot)paquier(at)gmail(dot)com> wrote:
> On Fri, Apr 14, 2017 at 2:47 AM, Fujii Masao <masao(dot)fujii(at)gmail(dot)com> wrote:
>> I'm thinking that it's less confusing to report always 0 as the priority of
>> async standby whatever the setting of synchronous_standby_names is.
>> Thought?
>
> Or we could have priority being reported to NULL for async standbys as
> well, the priority number has no meaning for them anyway...

I agree to set the same thing (priority or NULL) to all sync standby
in a quorum set. As Fujii-san mentioned, I also think that it means
all standbys in a quorum set can be chosen equally. But to less
confusion for current user I'd not like to change current behavior of
the priority of async standby.

>
>> If we adopt this idea, in a quorum-based sync replication, I think that
>> the priorities of all the standbys listed in synchronous_standby_names
>> should be 1 instead of NULL. That is, those standbys have the same
>> (highest) priority, and which means that any of them can be chosen as
>> sync standby. Thought?
>
> Mainly my fault here to suggest that standbys in a quorum set should
> have a priority set to NULL. My 2c on the matter is that I would be
> fine with either having the async standbys having a priority of NULL
> or using a priority of 1 for standbys in a quorum set. Though,
> honestly, I find that showing a priority number for something where
> this has no real meaning is even more confusing..

This is just a thought but we can merge sync_priority and sync_state
into one column. The sync priority can have meaning only when the
standby is considered as a sync standby or a potential standby in
priority-based sync replication. For example, we can show something
like 'sync:N' as states of the sync standby and 'potential:N' as
states of the potential standby in priority-based sync replication,
where N means the priority. In quorum-based sync replication it is
just 'quorum'. It breaks backward compatibility, though.

Regards,

--
Masahiko Sawada
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2017-04-14 01:55:19 Re: SUBSCRIPTIONS and pg_upgrade
Previous Message Petr Jelinek 2017-04-14 01:47:12 Re: SUBSCRIPTIONS and pg_upgrade