Re: BUG #19961: Deadlock detector misses a cycle between a READ ONLY DEFERRABLE safe-snapshot wait and a table lock

From: shihao zhong <zhong950419(at)gmail(dot)com>
To: james(dot)moore(at)g5labs(dot)ai
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #19961: Deadlock detector misses a cycle between a READ ONLY DEFERRABLE safe-snapshot wait and a table lock
Date: 2026-12-05 04:38:28
Message-ID: CAGRkXqSH+=XL1Y9y0CSaT1hqxseUE8dFqxV+QTrLK3wTF8OJGw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hi James,

On Mon, Nov 30, 2026, PG Bug reporting form wrote:
> Expected: the cycle is detected and one transaction gets 40P01, or the
> documentation says that a DEFERRABLE wait can deadlock with a lock waiter
> without detection.

I can reproduce this on master. Making the deadlock detector see the
safe snapshot wait looks like a lot of work for a case that needs an
explicit lock before the first query. I think a documentation note is
enough, but I'd like to hear if others prefer a code fix.

Thanks,
Shihao

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message shihao zhong 2026-12-05 05:05:29 Re: dbase_redo: XLOG_DBASE_CREATE_FILE_COPY replay empties live database
Previous Message shihao zhong 2026-12-05 04:32:53 Re: BUG #19705: One NaN box makes a BRIN box_inclusion_ops index omit unrelated rows