Re: walsender: Assert MyReplicationSlot is set before use

From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>
Cc: "Zhijie Hou (Fujitsu)" <houzj(dot)fnst(at)fujitsu(dot)com>, Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: walsender: Assert MyReplicationSlot is set before use
Date: 2026-02-03 05:12:35
Message-ID: CAHGQGwFYFgmfRBVkYcJen1AM-pA=iRDwGEhkwEVkz-2Wa8aEFw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Feb 3, 2026 at 12:38 PM Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com> wrote:
> > I think we cannot assume the slot type here. A suitable checking might
> > be: If a physical slot was acquired during logical replication, report an error,
> > just like we do in StartReplication().
>
> Good point. In StartReplication(), we check MyReplicationSlot is not logical, correspondingly, in StartLogicalReplication(), we should check MyReplicationSlot is not physical.

StartLogicalReplication() calls CreateDecodingContext() after
ReplicationSlotAcquire(), and CreateDecodingContext() seems to
already perform this check. Isn't that sufficient?

Regards,

--
Fujii Masao

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ashutosh Bapat 2026-02-03 05:18:30 Remove freelist reference in buf_init.c
Previous Message Michael Paquier 2026-02-03 05:01:20 Re: Add expressions to pg_restore_extended_stats()