Re: Adding REPACK [concurrently] - Mailing list pgsql-hackers

From Mihail Nikalayeu
Subject Re: Adding REPACK [concurrently]
Date
Msg-id CADzfLwUJe5B4XGL45zxYuWZE7EFTOG9L1tU33iaGxWV2kJC_VA@mail.gmail.com
Whole thread
In response to Re: Adding REPACK [concurrently]  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
List pgsql-hackers
Hello, Álvaro!

>  Right.  I spent some time looking at this patch just before pgconf.dev

Thanks!

> I have to admit I was a bit scared -- that code is really
> non-obvious, and breakage here could mean big trouble in case something
> goes wrong in weird situations.

Another option we may consider for pg19 - is just a simple
local-memory flag: "If I detect a deadlock and I am REPACK - cancel
another, not me".
It doesn't handle all tricky cases, but it deals with the most common
ones and is much easier and less invasive to implement.

It reuses mechanics that were already present (though unused, they
were documented as "for future" in comments).
POC of that approach is here - [0].

Best regards,
Mikhail.

[0]:
https://www.postgresql.org/message-id/flat/CADzfLwURKVNQ++Dpi7bjoGfj-8pchDQEVex3eWBx0NCYn6TbDQ@mail.gmail.com#bceb18354aa20c130a94b1deedd76fb7



pgsql-hackers by date:

Previous
From: Alexander Lakhin
Date:
Subject: 048_vacuum_horizon_floor.pl hangs due to wakeup lost inside LockBufferForCleanup
Next
From: Jeff Davis
Date:
Subject: Re: Bug in ALTER SUBSCRIPTION ... SERVER / ... CONNECTION with broken old server