Re: AIO v2.2 - Mailing list pgsql-hackers

From Andres Freund
Subject Re: AIO v2.2
Date
Msg-id 77wnjrkgzh6oydi5of7o4walq22wmyrdhydkkmedtjoyali6jd@d6mm3dcjugdo
Whole thread Raw
In response to Re: AIO v2.2  (Heikki Linnakangas <hlinnaka@iki.fi>)
List pgsql-hackers
Hi,

I was just going through comments about LWLockDisown() and was reminded of
this:

On 2025-01-07 18:08:51 +0200, Heikki Linnakangas wrote:
> On LWLockDisown():
> > + * NB: This will leave lock->owner pointing to the current backend (if
> > + * LOCK_DEBUG is set). We could add a separate flag indicating that, but it
> > + * doesn't really seem worth it.
> 
> Hmm. I won't insist, but I feel it probably would be worth it. This is only
> in LOCK_DEBUG mode so there's no performance penalty in non-debug builds,
> and when you do compile with LOCK_DEBUG you probably appreciate any extra
> information.

I don't think that makes sense, as we, independent of this change, never clear
lock->owner. Not even when releasing a lock!  The background to that, I think,
is that there were some cases where we forgot to wake up all backends due to
race conditions, and that for that it's really useful to know the last owner.

That could perhaps be evolved or documented better, but it's pretty much
independent of the patch at hand.

Greetings,

Andres Freund



pgsql-hackers by date:

Previous
From: Maiquel Grassi
Date:
Subject: Re: Psql meta-command conninfo+
Next
From: Masahiko Sawada
Date:
Subject: Re: pg_trgm comparison bug on cross-architecture replication due to different char implementation