Re: Reset waitStart when a lock wait fails - Mailing list pgsql-hackers

From Fujii Masao
Subject Re: Reset waitStart when a lock wait fails
Date
Msg-id CAHGQGwF46z3XLZxT8bXqUcNypT6R+qhYCqwMwrBcZfgzQQy+Sg@mail.gmail.com
Whole thread
In response to Re: Reset waitStart when a lock wait fails  (Michael Paquier <michael@paquier.xyz>)
Responses Re: Reset waitStart when a lock wait fails
List pgsql-hackers
On Thu, Sep 24, 2026 at 2:09 PM Michael Paquier <michael@paquier.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



pgsql-hackers by date:

Previous
From: Nisha Moond
Date:
Subject: Re: Proposal: Conflict log history table for Logical Replication
Next
From: Trakshan Mishra
Date:
Subject: Re: [PATCH] Clear FatalError earlier during crash restart