Re: Support for N synchronous standby servers - take 2

From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Cc: Simon Riggs <simon(at)2ndquadrant(dot)com>, Josh Berkus <josh(at)agliodbs(dot)com>, Sawada Masahiko <sawada(dot)mshk(at)gmail(dot)com>, Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Beena Emerson <memissemerson(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Support for N synchronous standby servers - take 2
Date: 2015-07-15 10:39:04
Message-ID: CANP8+j+MdPWJjGLaStfW0tybJDJh56FR-GSu97046jodXzX6Ng@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 15 July 2015 at 10:03, Michael Paquier <michael(dot)paquier(at)gmail(dot)com> wrote:

> OK, so this is leading us to the following points:
> - Use a JSON object to define the quorum/priority groups for the sync
> state.
> - Store it as a GUC, and use the check hook to validate its format,
> which is what we have now with s_s_names
> - Rely on SIGHUP to maintain an in-memory image of the quorum/priority
> sync state
> - Have the possibility to define group labels in this JSON blob, and
> be able to use those labels in a quorum or priority sync definition.
>

+1

> - For backward-compatibility, use for example s_s_names = 'json' to
> switch to the new system.
>

Seems easy enough to check to see if it is has a leading { and then treat
it as if it is an attempt to use JSON (which may fail), otherwise use the
old syntax.

> Also, as a first step of the implementation, do we actually need a set
> of functions to manipulate the JSON blob. I mean, we could perhaps
> have them in contrib/ but they do not seem mandatory as long as we
> document correctly how to document a label group and define a quorum
> or priority group, no?
>

Agreed, no specific functions needed to manipulate this field.

If we lack the means to manipulate JSON in SQL that can be solved outside
of the scope of this patch, because its just JSON.

--
Simon Riggs http://www.2ndQuadrant.com/
<http://www.2ndquadrant.com/>
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2015-07-15 11:25:04 Re: Support for N synchronous standby servers - take 2
Previous Message Andres Freund 2015-07-15 09:08:53 Re: security labels on databases are bad for dump & restore