Re: Issue with logical replication slot during switchover

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: Alexander Kukushkin <cyberdemn(at)gmail(dot)com>
Cc: Fabrice Chapuis <fabrice636861(at)gmail(dot)com>, shveta malik <shveta(dot)malik(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Shlok Kyal <shlok(dot)kyal(dot)oss(at)gmail(dot)com>
Subject: Re: Issue with logical replication slot during switchover
Date: 2025-11-13 08:42:36
Message-ID: CAA4eK1K6ziMep5L1XxfJp0Fpm2pbEyuk1zqqH4fPMwAuhC=m0w@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Nov 12, 2025 at 12:58 PM Alexander Kukushkin
<cyberdemn(at)gmail(dot)com> wrote:
>
> On Wed, 12 Nov 2025 at 05:22, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
>>
>> It is difficult to tell when this can happen but you detailed there is
>> a theoretical possibility of the same. If we had an in-core cluster
>> tool that manages nodes on its own which doesn't allow such scenarios
>> to happen then we could possibly say that using such a tool it is safe
>> to overwrite old primary's slots.
>
>
> That's a lot of ifs, and none of them could be fulfilled in the foreseeable future.
>
> Situation you describe is impossible.
> When there is a split-brain and someone drops and re-creating logical slots with the same names on the old primary - such node can't be joined as a standby without pg_rewind.
> In its current state pg_rewind wipes the pg_replslot directory, and therefore there will be no replication slots.
>

Say, the only operations that happened are slot-drop-recreate and or
some operations on unlogged tables. Why then pg_rewind is required?

--
With Regards,
Amit Kapila.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alexander Kukushkin 2025-11-13 09:06:53 Re: Issue with logical replication slot during switchover
Previous Message Akshay Joshi 2025-11-13 08:32:30 Re: [PATCH] Add pg_get_database_ddl() function to reconstruct CREATE DATABASE statement