Re: WaitForOlderSnapshots in DETACH PARTITION causes deadlocks

2023-07-26 Thread Alvaro Herrera
On 2023-Jul-25, Michael Paquier wrote: > On Mon, Jul 24, 2023 at 07:40:04PM +, Imseih (AWS), Sami wrote: > > WaitForOlderSnapshots is used here to ensure that snapshots older than > > the start of the ALTER TABLE DETACH CONCURRENTLY are completely removed > > to guarantee consistency, however

Re: WaitForOlderSnapshots in DETACH PARTITION causes deadlocks

2023-07-25 Thread Michael Paquier
On Mon, Jul 24, 2023 at 07:40:04PM +, Imseih (AWS), Sami wrote: > WaitForOlderSnapshots is used here to ensure that snapshots older than > the start of the ALTER TABLE DETACH CONCURRENTLY are completely removed > to guarantee consistency, however it does seem to cause deadlocks for at > least

WaitForOlderSnapshots in DETACH PARTITION causes deadlocks

2023-07-24 Thread Imseih (AWS), Sami
Hi, While recently looking into partition maintenance, I found a case in which DETACH PARTITION FINALIZE could case deadlocks. This occurs when a ALTER TABLE DETACH CONCURRENTLY, followed by a cancel, the followed by an ALTER TABLE DETACH FINALIZE, and this sequence of steps occur in the middle