Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sPLoE-004BpP-1W for pgsql-hackers@arkaria.postgresql.org; Thu, 04 Jul 2024 12:43:34 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1sPLoB-00HDNE-Ju for pgsql-hackers@arkaria.postgresql.org; Thu, 04 Jul 2024 12:43:32 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sPLoB-00HDN6-90 for pgsql-hackers@lists.postgresql.org; Thu, 04 Jul 2024 12:43:32 +0000 Received: from mail-ed1-x52d.google.com ([2a00:1450:4864:20::52d]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sPLo4-000O9a-HE for pgsql-hackers@postgresql.org; Thu, 04 Jul 2024 12:43:30 +0000 Received: by mail-ed1-x52d.google.com with SMTP id 4fb4d7f45d1cf-58b966b41fbso859860a12.1 for ; Thu, 04 Jul 2024 05:43:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb.com; s=google; t=1720097002; x=1720701802; darn=postgresql.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=CTujz8/rRsocUjk8dTvW/ko27bJYJn+h5uy31NAoHhI=; b=g6KSUcJiUo0Nj2/MxrZMJczVWU2CA/uobI829moAlyMSRvhfkN7mBkV7snLH6V/Icn GmdQLFi+jbyTDPRAMuz28mzSGSI6nYukB3gQ22Sfa0xmnujldUSz9A7TEklK2M7teLMS GHiXL41SDtVPbyKbSDxMrlnhnrpkZl5Pf2qIc+TZbFUkCiLdCrd/LUf8MECgtqdrnTzz q/mnxPBeLB30a4/6ywv3Jt5tjKpCuRd4ondWAiJIXi3hlYcVbv3sxPMeP8C7wCtXlZFw PA9ZLmOz34Or2IO2RHm29mHLD3CI+VK/RTWTxQxwNU1XtCo4V+YzOyfUTInX2TAGXRZF p4hQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720097002; x=1720701802; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=CTujz8/rRsocUjk8dTvW/ko27bJYJn+h5uy31NAoHhI=; b=CwOM9WQTQBHPCT00o3nCL+fWgiC56RLqkK1GB0trJ5uxnOy3Fg5PjrV2FKwh5zPFbd xHGBeAu8iOeyLm/zFykgcXRULfFrFTC3fgDAQ6jcWi2KaWOtmXAW92V5837qpnO8vTZZ LvQY/O0DmI9SDJ0gykGJMKF4LAYblneR6XgO8PsMNIgXgujMtTB8CI8YuKTzSVlpnwUG 00/J9e0PKGEeTXGVNbyIDX2EjhhG402XMzyYqLQChcoo2FByrytz7ifOrADqfvy2yKMY mO1Coeh5zXD+dIrPHkH0A6gszzQSmln4JlhSAFLtQV1JL8eU3khh9aXigEJiJYFN9s7l mXvg== X-Gm-Message-State: AOJu0YykHdhMTPNWHkb5brDfAr3wo4p3B0p7UYuDgn2hJUdwqJSMl010 yVMht0mwcxGkrKX3WAS2AI6xZsgb5pnZeUcICT3uezWiD5rSonRXk38QhPD5pg== X-Google-Smtp-Source: AGHT+IEyiDnbZLbGd6Z44LLU5O8Aow7pBX9FSxM1qzoxNDsV/IqtWS40oH4GfmoqczKUwjc+9IhB3w== X-Received: by 2002:a05:6402:2754:b0:582:ca34:31b1 with SMTP id 4fb4d7f45d1cf-58e5984c1ddmr1271970a12.16.1720097002077; Thu, 04 Jul 2024 05:43:22 -0700 (PDT) Received: from [10.137.0.18] (ip-86-49-229-30.bb.vodafone.cz. [86.49.229.30]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5861324f08esm8337036a12.27.2024.07.04.05.43.21 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 04 Jul 2024 05:43:21 -0700 (PDT) Message-ID: <328b01a4-b2c0-40da-ab14-f7f005d4e0e3@enterprisedb.com> Date: Thu, 4 Jul 2024 14:43:20 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Make query cancellation keys longer To: Heikki Linnakangas , Jelte Fennema-Nio Cc: pgsql-hackers , Thomas Munro , Robert Haas References: <508d0505-8b7a-4864-a681-e7e5edfe32aa@iki.fi> <02a4eed2-98f0-4796-9d4f-12128ff44fe0@iki.fi> <2317e205-0e7c-4e69-b04a-653232a1d3e1@iki.fi> Content-Language: en-US From: Tomas Vondra In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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