Re: Set new system identifier using pg_resetxlog - Mailing list pgsql-hackers

From Petr Jelinek
Subject Re: Set new system identifier using pg_resetxlog
Date
Msg-id 53A051C5.6030609@2ndquadrant.com
Whole thread Raw
In response to Re: Set new system identifier using pg_resetxlog  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: Set new system identifier using pg_resetxlog
List pgsql-hackers
On 17/06/14 16:18, Robert Haas wrote:
> On Fri, Jun 13, 2014 at 8:31 PM, Petr Jelinek <petr@2ndquadrant.com> wrote:
>> attached is a simple patch which makes it possible to change the system
>> identifier of the cluster in pg_control. This is useful for
>> individualization of the instance that is started on top of data directory
>> produced by pg_basebackup - something that's helpful for logical replication
>> setup where you need to easily identify each node (it's used by
>> Bidirectional Replication for example).
>
> I can clearly understand the utility of being able to reset the system
> ID to a new, randomly-generated system ID - but giving the user the
> ability to set a particular value of their own choosing seems like a
> pretty sharp tool.  What is the use case for that?
>

Let's say you want to initialize new logical replication node via 
pg_basebackup and you want your replication slots to be easily 
identifiable so you use your local system id as part of the slot name.

In that case you need to know the future system id of the node because 
you need to register the slot before consistent point to which you 
replay via streaming replication (and you can't replay anymore once you 
changed the system id). Which means you need to generate your system id 
in advance and be able to change it in pg_control later.

--  Petr Jelinek                  http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training &
Services



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: Minmax indexes
Next
From: Abhijit Menon-Sen
Date:
Subject: Re: [patch] pg_copy - a command for reliable WAL archiving