Re: Reset waitStart when a lock wait fails

From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>, shihao zhong <zhong950419(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Alex Shapalov <shapalov(at)gmail(dot)com>, Sami Imseih <samimseih(dot)pg(at)gmail(dot)com>
Subject: Re: Reset waitStart when a lock wait fails
Date: 2026-09-25 10:07:13
Message-ID: CAHGQGwF46z3XLZxT8bXqUcNypT6R+qhYCqwMwrBcZfgzQQy+Sg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Sep 24, 2026 at 2:09 PM Michael Paquier <michael(at)paquier(dot)xyz> wrote:
> > Looks good to me. Once proc->waitLock is cleared, proc->waitStart no
> > longer describes an active wait, so clearing it at the same time
> > seems right.
>
> Yep, it looks weird to not clean up the field in this code path.
> @Fujii-san, what do you think?

The patch looks good to me!

BTW, ProcWakeup() can reset waitStart before the waiter updates it in
ProcSleep() (or ResolveRecoveryConflictWithLock() during hot standby)?
If so, seems waitStart could remain set even after the wait, causing the same
issue. To fix this, we should reset waitStart at the end of ProcSleep() and
in LockErrorCleanup() as well?

Regards,

--
Fujii Masao

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Trakshan Mishra 2026-09-25 10:38:20 Re: [PATCH] Clear FatalError earlier during crash restart
Previous Message Nisha Moond 2026-09-25 09:59:24 Re: Proposal: Conflict log history table for Logical Replication