Re: Copy function for logical replication slots

From: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Copy function for logical replication slots
Date: 2018-06-28 06:34:00
Message-ID: CAD21AoDe6ZQvh600KaBDVzBqPu1mt0=6U8dxB6NUeL_T_A9pdg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Jun 28, 2018 at 12:29 PM, Michael Paquier <michael(at)paquier(dot)xyz> wrote:
> On Thu, Jun 28, 2018 at 11:51:20AM +0900, Masahiko Sawada wrote:
>> A use case I imagined is for investigations for example. I mean that
>> when replication collision occurs on subscriber there is no way to see
>> what replicated data is conflicting (perhaps error log helps it but is
>> not detailed) and there is no way to advance a replication origin in
>> order to exactly skip to apply conflicting data. By creating a new
>> logical slot with a different output plugin at the same LSN, we can
>> see what data a replication slot will decode (and send) and those LSNs
>> as well. This function will help for that purpose.
>
> Hm. Shouldn't the original slot copied be owned by the process doing
> the copy with ReplicationSlotAcquire?

Right, it should do and release it before creating new one.

> There could be some cases where
> copying a physical slot also makes sense.

I've thought that but I didn't find concrete use case. That's why I
started with only logical slot.

Attached v2 patch.

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

Attachment Content-Type Size
v2-0001-Copy-logical-replication-slot.patch application/octet-stream 13.8 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2018-06-28 06:37:00 Re: alter index WITH ( storage_parameter = value [, ... ] ) for partition index.
Previous Message Rajkumar Raghuwanshi 2018-06-28 06:21:23 Re: alter index WITH ( storage_parameter = value [, ... ] ) for partition index.