Re: Add client connection check during the execution of the query

From: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Maksim Milyutin <milyutinma(at)gmail(dot)com>, "tsunakawa(dot)takay(at)fujitsu(dot)com" <tsunakawa(dot)takay(at)fujitsu(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Tatsuo Ishii <ishii(at)sraoss(dot)co(dot)jp>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Zhihong Yu <zyu(at)yugabyte(dot)com>
Subject: Re: Add client connection check during the execution of the query
Date: 2021-12-14 10:50:49
Message-ID: CA+hUKG+J2pNb5bQv+G8BsAfVMd_QF1UCSakK=MW5fTdEkdZAGg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Dec 14, 2021 at 11:18 AM Thomas Munro <thomas(dot)munro(at)gmail(dot)com> wrote:
> On Tue, Dec 14, 2021 at 7:53 AM Andres Freund <andres(at)anarazel(dot)de> wrote:
> > On 2021-12-13 17:51:00 +1300, Thomas Munro wrote:
> > > I tried that. It seems OK, and gets rid of the PG_FINALLY(), which is
> > > nice. Latches still have higher priority, and still have the fast
> > > return if already set and you asked for only one event, but now if you
> > > ask for nevents > 1 we'll make the syscall too so we'll see the
> > > WL_SOCKET_CLOSED.
> >
> > Isn't a certain postgres committer that cares a lot about unnecessary syscalls
> > going to be upset about this one? Even with the nevents > 1 optimization? Yes,
> > right now there's no other paths that do so, but I don't like the corner this
> > paints us in.
>
> Well, I was trying to avoid bikeshedding an API change just for a
> hypothetical problem we could solve when the time comes (say, after
> fixing the more egregious problems with Append's WES usage), but here
> goes: we could do something like AddWaitEventToSet(FeBeWaitSet,
> WL_LATCH_SET_LOPRIO, ...) that is translated to WL_LATCH_SET
> internally but also sets a flag to enable this
> no-really-please-poll-all-the-things-if-there-is-space behaviour.

Here's one like that.

Attachment Content-Type Size
v5-0001-Add-WL_SOCKET_CLOSED-for-socket-shutdown-events.patch text/x-patch 7.8 KB
v5-0002-Add-support-for-lower-priority-latches.patch text/x-patch 6.1 KB
v5-0003-Use-WL_SOCKET_CLOSED-for-client_connection_check_.patch text/x-patch 5.3 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2021-12-14 11:12:10 Re: row filtering for logical replication
Previous Message Dilip Kumar 2021-12-14 10:11:27 Re: Skipping logical replication transactions on subscriber side