On Fri, 7 Jun 2024 at 20:58, David Rowley <dgrowleyml@gmail.com> wrote:
> s1: create table t ();
> s1: begin;
> s2: begin;
> s1: lock table t in access share mode;
> s2: lock table t in access share mode;
> s1: lock table t in access exclusive mode;
> s2: lock table t in access exclusive mode; -- deadlock
>
> Isn't this more or less the same as what's going on in your scenario?
I didn't explain why this needs to happen... s1 can't get the AEL on
"t" because it's blocked by s2's share lock. Subsequently, s2 then
must wait on s1's AEL request and that creates a deadlock cycle that
needs to be broken.
David