Re: Set new system identifier using pg_resetxlog

From: Petr Jelinek <petr(at)2ndquadrant(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Set new system identifier using pg_resetxlog
Date: 2014-06-17 14:33:41
Message-ID: 53A051C5.6030609@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 17/06/14 16:18, Robert Haas wrote:
> On Fri, Jun 13, 2014 at 8:31 PM, Petr Jelinek <petr(at)2ndquadrant(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Abhijit Menon-Sen 2014-06-17 14:53:01 Re: [patch] pg_copy - a command for reliable WAL archiving
Previous Message Andres Freund 2014-06-17 14:31:45 Re: Minmax indexes