pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tomas Vondra <tomas.vondra@enterprisedb.com>
To: Heikki Linnakangas <hlinnaka@iki.fi>
To: Jelte Fennema-Nio <postgres@jeltef.nl>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Cc: Thomas Munro <thomas.munro@gmail.com>
Cc: Robert Haas <robertmhaas@gmail.com>
Subject: Re: Make query cancellation keys longer
Date: Thu, 4 Jul 2024 14:43:20 +0200
Message-ID: <328b01a4-b2c0-40da-ab14-f7f005d4e0e3@enterprisedb.com> (raw)
In-Reply-To: <d6b43345-d1a9-4081-9360-684ebba17d33@iki.fi>
References: <508d0505-8b7a-4864-a681-e7e5edfe32aa@iki.fi>
	<CAGECzQSMF7qUF7WTVcjk6qVOz=3du6naLVXRKnZ9AUtM9kQ31w@mail.gmail.com>
	<CAGECzQSGzRE9eF=twhDgDXGKQVzrx=WhhVPEUmbQoDsHAVKQkg@mail.gmail.com>
	<CAGECzQTjFAz=OErVJbH8kbdVze_rnXeufGSbNKw+mpzOEWe8cw@mail.gmail.com>
	<02a4eed2-98f0-4796-9d4f-12128ff44fe0@iki.fi>
	<CA+TgmoZQWXBBxoRrjb-+Dz9yxipDP+55hNVWuc_cuXH0cpDayw@mail.gmail.com>
	<c6ed087e-1b41-4b06-9f7e-350acb887f83@iki.fi>
	<2317e205-0e7c-4e69-b04a-653232a1d3e1@iki.fi>
	<CAGECzQTNSSN4di_J10mXaanZKnTvONAYxVBpPPdssupQ22xSpA@mail.gmail.com>
	<d6b43345-d1a9-4081-9360-684ebba17d33@iki.fi>

Hi,

I don't have any immediate feedback regarding this patch, but I'm
wondering about one thing related to cancellations - we talk cancelling
a query, but we really target a PID (or a particular backend, no matter
how we identify it).

I occasionally want to only cancel a particular query, but I don't think
that's really possible - the query may complete meanwhile, and the
backend may even get used for a different user connection (e.g. with a
connection pool)? Or am I missing something important?

Anyway, I wonder if making the cancellation key longer (or variable
length) might be useful for this too - it would allow including some
sort of optional "query ID" in the request, not just the PID. (Maybe
st_xact_start_timestamp would work?)

Obviously, that's not up to this patch, but it's somewhat related.



regards

-- 
Tomas Vondra
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company





view thread (40+ messages)  latest in thread

Message-ID: <328b01a4-b2c0-40da-ab14-f7f005d4e0e3@enterprisedb.com>
Permalink:  ../328b01a4-b2c0-40da-ab14-f7f005d4e0e3@enterprisedb.com/
Also on:    postgresql.org/message-id/328b01a4-b2c0-40da-ab14-f7f005d4e0e3@enterprisedb.com

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: tomas.vondra@enterprisedb.com, hlinnaka@iki.fi, postgres@jeltef.nl, thomas.munro@gmail.com, robertmhaas@gmail.com
  Subject: Re: Make query cancellation keys longer
  In-Reply-To: <328b01a4-b2c0-40da-ab14-f7f005d4e0e3@enterprisedb.com>
  References: <508d0505-8b7a-4864-a681-e7e5edfe32aa@iki.fi> <CAGECzQSMF7qUF7WTVcjk6qVOz=3du6naLVXRKnZ9AUtM9kQ31w@mail.gmail.com> <CAGECzQSGzRE9eF=twhDgDXGKQVzrx=WhhVPEUmbQoDsHAVKQkg@mail.gmail.com> <CAGECzQTjFAz=OErVJbH8kbdVze_rnXeufGSbNKw+mpzOEWe8cw@mail.gmail.com> <02a4eed2-98f0-4796-9d4f-12128ff44fe0@iki.fi> <CA+TgmoZQWXBBxoRrjb-+Dz9yxipDP+55hNVWuc_cuXH0cpDayw@mail.gmail.com> <c6ed087e-1b41-4b06-9f7e-350acb887f83@iki.fi> <2317e205-0e7c-4e69-b04a-653232a1d3e1@iki.fi> <CAGECzQTNSSN4di_J10mXaanZKnTvONAYxVBpPPdssupQ22xSpA@mail.gmail.com> <d6b43345-d1a9-4081-9360-684ebba17d33@iki.fi> <328b01a4-b2c0-40da-ab14-f7f005d4e0e3@enterprisedb.com>

* 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