public inbox for [email protected]
help / color / mirror / Atom feedFrom: Arseniy Mukhin <[email protected]>
To: Chao Li <[email protected]>
Cc: Joel Jacobson <[email protected]>
Cc: pgsql-hackers <[email protected]>
Subject: Re: Optimize LISTEN/NOTIFY
Date: Wed, 5 Nov 2025 20:51:01 +0300
Message-ID: <CAE7r3MJ0VoAJzdLzX0dgfPJpBJxW+wg_pYaCi6mQJi47+qukhg@mail.gmail.com> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<CAK80=jhmE40KVqQ3ho37MArS7cAED1p9m7uikDxcnDmqdW7t8A@mail.gmail.com>
<[email protected]>
<[email protected]>
<CA+hUKGLrMGkWDB0cwTa0RqD+AF7O-Ywgck8aVYKwOQnZgYRRug@mail.gmail.com>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<CAFY6G8dap-bCnAnMG-2Gzew8yv2Vbi9gsx9+yszKMmd57ygfvA@mail.gmail.com>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<CAE7r3MLivh1sHWF06hrVXkiQbw-KChPcQsh+9CheXprm5vRVMQ@mail.gmail.com>
<[email protected]>
<CAE7r3MK-3AOdh1mpZ8hw9h6F_i0D5RMoAy7CttnfCJRpB8GJDA@mail.gmail.com>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<CAE7r3MJxxycYwDFJdTJ+HmzeNJ_JGKyr4HpT5njN1ouVX56OUg@mail.gmail.com>
<[email protected]>
On Wed, Nov 5, 2025 at 12:22 PM Chao Li <[email protected]> wrote:
>
>
>
> > On Nov 2, 2025, at 04:41, Arseniy Mukhin <[email protected]> wrote:
> >
> > This condition seems to be redundant. I would say it should always be
> > true, otherwise it would mean that somebody allowed the listener to
> > skip our notification.
>
> Hi Arseniy,
>
Hi Chao,
> Did you read the example I explained in my previous email?
>
Yes, I read it. Thank you for the example. It shows the case where we
can fail to apply 'direct advancement'. I think there are several
cases where it can happen. IIUC all such cases are about lagging
listeners that failed to catch up with the head before the notifier
tries to apply 'direct advancement' to them. Your example is about
listeners that finished reading but didn't update their positions
because they were stuck on the lock. I think it is also possible that
the listener can be in the process of reading or even didn't start
reading at all (for example listener backend is in the active
transaction at the moment). In these cases we also can't apply direct
advancement. Don't know if some of these examples are more important,
maybe some of them can be met more frequently.
I think the current version of 'direct advancement' will work good for
'sleepy' listeners, but probably can be not very efficient for
listeners that get notifications frequently, don't know. But maybe
it's ok, we have optimization that sometimes works and have a quite
simple implementation.
Best regards,
Arseniy Mukhin
view thread (118+ messages) latest in thread
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: [email protected]
Cc: [email protected], [email protected], [email protected]
Subject: Re: Optimize LISTEN/NOTIFY
In-Reply-To: <CAE7r3MJ0VoAJzdLzX0dgfPJpBJxW+wg_pYaCi6mQJi47+qukhg@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox