Re: BUG #14228: replication slot catalog_xmin not cleared on slot reuse - Mailing list pgsql-bugs

From Andres Freund
Subject Re: BUG #14228: replication slot catalog_xmin not cleared on slot reuse
Date
Msg-id 20160728002437.t4xvmdkgelwwsm75@alap3.anarazel.de
Whole thread Raw
In response to Re: BUG #14228: replication slot catalog_xmin not cleared on slot reuse  (Michael Paquier <michael.paquier@gmail.com>)
Responses Re: BUG #14228: replication slot catalog_xmin not cleared on slot reuse
List pgsql-bugs
On 2016-07-06 13:07:36 +0900, Michael Paquier wrote:
> _
>
> On Wed, Jul 6, 2016 at 12:56 PM, Andrew Gierth
> <andrew@tao11.riddles.org.uk> wrote:
> >>>>>> "Michael" == Michael Paquier <michael.paquier@gmail.com> writes:
> >
> >  >> When creating a physical replication slot, the catalog_xmin field of
> >  >> the new slot is not initialized. If the slot storage had previously
> >  >> been used for a logical slot, the old catalog_xmin will remain in
> >  >> place and interfere with vacuum.
> >
> >  Michael> Good catch! The same applies to confirmed_flush_lsn, which is
> >  Michael> used only by logical decoding and should remain as NULL for
> >  Michael> physical slots.  So I propose the patch attached to address
> >  Michael> both problems.
> >
> > What about slot->effective_catalog_xmin ?
>
> Yes. I guess so, as well as the other candidate_* fields in the slot
> to begin from a clean state.

I think it'd be better if we explicitly zeroed .data - that way the
likelihood of future bugs of the same ilk is smaller.

Greetings,

Andres Freund

pgsql-bugs by date:

Previous
From: Andres Freund
Date:
Subject: Re: BUG #14150: Attempted to delete invisible tuple
Next
From: Peter Geoghegan
Date:
Subject: Re: BUG #14150: Attempted to delete invisible tuple