pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Antonin Houska <ah@cybertec.at>
To: Thomas Munro <thomas.munro@gmail.com>
Cc: Tomas Vondra <tomas.vondra@enterprisedb.com>
Cc: Andres Freund <andres@anarazel.de>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: walsender "wakeup storm" on PG16, likely because of bc971f4025c (Optimize walsender wake up logic using condition variables)
Date: Wed, 16 Aug 2023 13:20:23 +0200
Message-ID: <3029.1692184823@antos> (raw)
In-Reply-To: <CA+hUKGLizA9-Hms7Co5P4UEiHJStCmuOg73PQ_+bRqUj-v27jA@mail.gmail.com>
References: <2840876b-4cfe-240f-0a7e-29ffd66711e7@enterprisedb.com>
	<20230811175111.3h7pwmezbvoglb5t@awork3.anarazel.de>
	<CA+hUKGLG--QGeCNd4+ur4eXnWcM3TD0ap1yH4akeBNHwg+CCSA@mail.gmail.com>
	<977682d0-a23e-9529-ccc6-8872769c0f6e@enterprisedb.com>
	<CA+hUKGLizA9-Hms7Co5P4UEiHJStCmuOg73PQ_+bRqUj-v27jA@mail.gmail.com>

Thomas Munro <thomas.munro@gmail.com> wrote:

> On Tue, Aug 15, 2023 at 2:23 AM Tomas Vondra
> <tomas.vondra@enterprisedb.com> wrote:
> > I'm not familiar with the condition variable code enough to have an
> > opinion, but the patch seems to resolve the issue for me - I can no
> > longer reproduce the high CPU usage.
> 
> Thanks, pushed.

I try to understand this patch (commit 5ffb7c7750) because I use condition
variable in an extension. One particular problem occured to me, please
consider:

ConditionVariableSleep() gets interrupted, so AbortTransaction() calls
ConditionVariableCancelSleep(), but the signal was sent in between. Shouldn't
at least AbortTransaction() and AbortSubTransaction() check the return value
of ConditionVariableCancelSleep(), and re-send the signal if needed?

Note that I'm just thinking about such a problem, did not try to reproduce it.

-- 
Antonin Houska
Web: https://www.cybertec-postgresql.com





view thread (9+ messages)  latest in thread

Message-ID: <3029.1692184823@antos>
Permalink:  ../3029.1692184823@antos/
Also on:    postgresql.org/message-id/3029.1692184823@antos

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: ah@cybertec.at, thomas.munro@gmail.com, tomas.vondra@enterprisedb.com, andres@anarazel.de, pgsql-hackers@lists.postgresql.org
  Subject: Re: walsender "wakeup storm" on PG16, likely because of bc971f4025c (Optimize walsender wake up logic using condition variables)
  In-Reply-To: <3029.1692184823@antos>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox