Mihail Nikalayeu <[email protected]> wrote: > I've briefly looked at your patch. As I understand it, it cancels the other > process only when REPACK actually tries to upgrade the lock. ... > > AFAIU, Andres's concern is that the "victim" should be cancelled > sooner, rather than waiting until REPACK actually attempts the > upgrade.
I thought the point is that the deadlock should be resolved in a controlled way, i.e. w/o relying on deadlock timeout. Once both processes sleep, the decision which one should be kicked off is effectively random. In other words, the actual deadlock IMO starts exactly at the moment both processes end up sleeping. But I may be wrong. -- Antonin Houska Web: https://www.cybertec-postgresql.com
