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

From Peter Smith
Subject DROP TABLE can crash the replication sync worker
Date
Msg-id CAHut+Pu7Z4a=omo+TvK5Gub2hxcJ7-3+Bu1FO_++fpFTW0oQfQ@mail.gmail.com
Whole thread Raw
Responses Re: DROP TABLE can crash the replication sync worker
List pgsql-hackers
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. In the particular test
case which found this, the result was a stack trace when a LOG message
tried to display the table name of the bad relid.

PSA the patch code to fix this. The patch disallows DROP TABLE while
any associated tablesync worker is still running. This fix was already
confirmed OK in the other thread [v25]

----
[master]
https://www.postgresql.org/message-id/CAHut%2BPtSO4WsZwx8z%3D%2BYp_OWpxFmmFi5WX6OmYJzULNa2NV89g%40mail.gmail.com
[v25] https://www.postgresql.org/message-id/CAHut%2BPtAKP1FoHbUEWN%2Ba%3D8Pg_njsJKc9Zoz05A_ewJSvjX2MQ%40mail.gmail.com

Kind Regards,
Peter Smith.
Fujitsu Australia

Attachment

pgsql-hackers by date:

Previous
From: Dilip Kumar
Date:
Subject: Re: Correct comment in StartupXLOG().
Next
From: Bharath Rupireddy
Date:
Subject: Re: Printing backtrace of postgres processes