Re: DROP TABLE can crash the replication sync worker - Mailing list pgsql-hackers

From Peter Smith
Subject Re: DROP TABLE can crash the replication sync worker
Date
Msg-id CAHut+PubaBTC1NABwTWAK7L8MxD3966_qFY4sLYMNt4=BxqKhg@mail.gmail.com
Whole thread Raw
In response to Re: DROP TABLE can crash the replication sync worker  (Amit Kapila <amit.kapila16@gmail.com>)
Responses Re: DROP TABLE can crash the replication sync worker
List pgsql-hackers
On Wed, Feb 3, 2021 at 11:49 PM Amit Kapila <amit.kapila16@gmail.com> wrote:
>
> On Wed, Feb 3, 2021 at 2:53 PM Peter Smith <smithpb2250@gmail.com> wrote:
> >
> > Hi Hackers.
> >
> > As discovered in another thread [master] there is an *existing* bug in
> > the PG HEAD code which can happen if a DROP TABLE is done at same time
> > a replication tablesync worker is running.
> >
> > It seems the table's relid that the sync worker is using gets ripped
> > out from underneath it and is invalidated by the DROP TABLE. Any
> > subsequent use of that relid will go wrong.
> >
>
> Where exactly did you pause the tablesync worker while dropping the
> table? We acquire the lock on the table in LogicalRepSyncTableStart
> and then keep it for the entire duration of tablesync worker so drop
> table shouldn't be allowed.
>

I have a breakpoint set on LogicalRepSyncTableStart. The DROP TABLE is
done while paused on that breakpoint, so no code of
LogicalRepSyncTableStart has even executed yet.

----
Kind Regards,
Peter Smith.
Fujitsu Australia



pgsql-hackers by date:

Previous
From: Tomas Vondra
Date:
Subject: Re: WIP: BRIN multi-range indexes
Next
From: Zhihong Yu
Date:
Subject: Re: Dumping/restoring fails on inherited generated column