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-8pchdqevex3ewbx0ncyn6t...@mail.gmail.com#bceb18354aa20c130a94b1deedd76fb7
