Re: [HACKERS] Multiple synchronous_standby_names rules

From: James Sewell <james(dot)sewell(at)jirotech(dot)com>
To: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [HACKERS] Multiple synchronous_standby_names rules
Date: 2020-06-09 02:37:03
Message-ID: CAANVwEsJSNTwQHrPJpp4+dci5Ffqc1cCgjMVUPD83ZXgdjVYVQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, 12 Jan 2017 at 12:06, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
wrote:

> On Thu, Jan 12, 2017 at 9:53 AM, James Sewell <james(dot)sewell(at)jirotech(dot)com>
> wrote:
> > What is needed to support this is the ability to configure Px with
> something like:
> >
> > 1 (P1, P2, P3), 1 (D1, D2, D3)
> >
> > Would there be any appetite for this - or would it be seen as over
> complication of the current rules?
>
> There have been discussions about being able to do that and there are
> really use cases where that would be useful. As lately quorum commit
> has been committed, we have a better idea of the grammar to use
> (yeah!), though there are a couple of things remaining regarding the
> design of node subsets:
> - How to define group names? Making them mandatory would likely be the
> way to go.
> - How to represent that intuitively in pg_stat_replication? Perhaps
> the answer here is an extra column in this system view.
>

I'm coming back round to this as it's becoming increasingly discussed as we
look into systems with an RPO of (close to) 0 spanning multiple locations.

Before I start hacking - does anyone have any preference for syntax?

To me the best approach seems to be a list of items like:

ANY 2 (a,b) AS SiteA, ANY 2(c,d) AS SiteB
FIRST 2 (a,b,c) AS SiteA, d AS SiteB, e AS SiteC

You need a group name for the replication view as Michael noted, I suppose
you'd need to also allow no group name (one would be autogenerated??) for
backwards compatibility OR enforce group names when there are more than one
elements in the list.

I don't want to do embedded groups like:

ANY 2 (ANY 2 (a,b,c) AS SiteA, d as SiteB, c as SiteB)

Because that just seems like it's overcomplicating the issue.

thoughts?

James

--
The contents of this email are confidential and may be subject to legal or
professional privilege and copyright. No representation is made that this
email is free of viruses or other defects. If you have received this
communication in error, you may not copy or distribute any part of it or
otherwise disclose its contents to anyone. Please advise the sender of your
incorrect receipt of this correspondence.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2020-06-09 02:40:44 Re: [Patch] pg_rewind: options to use restore_command from recovery.conf or command line
Previous Message Michael Paquier 2020-06-09 02:32:35 Re: BufFileRead() error signalling