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 1ruZRQ-006Bbn-O1 for pgsql-hackers@arkaria.postgresql.org; Wed, 10 Apr 2024 15:00:49 +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 1ruZRP-003xx5-DG for pgsql-hackers@arkaria.postgresql.org; Wed, 10 Apr 2024 15:00:47 +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 1ruZRP-003xww-3R for pgsql-hackers@lists.postgresql.org; Wed, 10 Apr 2024 15:00:47 +0000 Received: from mail-io1-xd36.google.com ([2607:f8b0:4864:20::d36]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1ruZRM-000DIr-3O for pgsql-hackers@postgresql.org; Wed, 10 Apr 2024 15:00:46 +0000 Received: by mail-io1-xd36.google.com with SMTP id ca18e2360f4ac-7d5db134badso173670339f.2 for ; Wed, 10 Apr 2024 08:00:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712761242; x=1713366042; darn=postgresql.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=QZrJ24edfdUzDNYfvgFClf/hQZ6tNSA/is3K5obYE3M=; b=Hf/gJVBWK/7NSaLuiF5cVawYRorOmzhgTYwWw2Z6EisBLSuidQvNtv5jykrJvM9GbX rzJnP247Vi2xSYX07LIPgmIYUAZA2AErTILHw0tOq2xuv7Aii3WkP4e99v092S98TVLM 2ZNfzSsg3dxaDgcOzhiqQQwKei/SG4Jotem0kEcDbgHVly5vhjeCtRBL03kQGkGRW/om uoFjWf04Fw1+5h3IKwDtVBgrnitciMVUXn60Q43LNZmEUY/eensAmRhWJftFeK+3HjEX W/eGNx/d8VDbAqyxUmcCfTodFmcdwV7jx+FMq25p7zKzvvW0Z7R2LY28u/aRE2C+7+JX QQ3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712761242; x=1713366042; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=QZrJ24edfdUzDNYfvgFClf/hQZ6tNSA/is3K5obYE3M=; b=UMAoakNZbmAvh8lKBhnAFgZ/ivlJv7seGDXqmKHJy0JSsujBP5qhikCIE8iX4QqFUB EYu8dSiL/Rarw/Su9PA8WOJuUf7Ek+YM4QnD+xFir445seKt6BNKnKzvMknBaMvIgq4L G1FD818K6EOah+ziByktw7j2yWSK/dNIulSyK0Z3BgegHPD1796fu9MztLHxpXNPa717 XQ+4gwxf+r4CCfaPMVEJLHzIrqLfu0SY8S55QyvwX9bXS0ELFz5+ChD3JJ8QmryiG3vn eruEon3HZ9nrPGXfJ+f4+dTE0oYStEhux9cYIt3NEoCy4BVPrFC4gu+00XMyk6ndVl7S RmOw== X-Forwarded-Encrypted: i=1; AJvYcCV0v9JrjyYxkAY4aIYK3xaeJj/GmxZgJrLUWiwldjYpB4YAMxFb++yktWtV+idy1ibTkXKi0osHLD+Pjw/m5UoD0D3TB49v8Ixnq9TT X-Gm-Message-State: AOJu0Yy1bUDmRaVQp4pb0Z08rWQw8hWPsvLtdo5Ul0rHqSSMJY+UF5bP pwObdfQGrgMGDGGHhGh6TsMW9GyoB2VgzIZW/7NnDnlWXZTGmcwx X-Google-Smtp-Source: AGHT+IEBGM2AdPBN4YxCGbXVTuGlDLA2/Ks8iiwKjjmcWHJka5YNsa97beMzDEli7JY51CJULs8daA== X-Received: by 2002:a05:6602:b97:b0:7d0:966f:556e with SMTP id fm23-20020a0566020b9700b007d0966f556emr3443538iob.12.1712761236956; Wed, 10 Apr 2024 08:00:36 -0700 (PDT) Received: from nathanxps13 (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id j4-20020a05663822c400b0047ed8c3e578sm3967372jat.134.2024.04.10.08.00.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Apr 2024 08:00:36 -0700 (PDT) Date: Wed, 10 Apr 2024 10:00:34 -0500 From: Nathan Bossart To: Michael Paquier Cc: Kirill Reshke , "Leung, Anthony" , "Andrey M. Borodin" , "pgsql-hackers@postgresql.org" Subject: Re: Allow non-superuser to cancel superuser tasks. Message-ID: <20240410150034.GA1673069@nathanxps13> References: <20240405125656.GA4102502@nathanxps13> <20240406010751.GA167028@nathanxps13> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, Apr 10, 2024 at 07:58:39AM +0900, Michael Paquier wrote: > On Wed, Apr 10, 2024 at 12:52:19AM +0300, Kirill Reshke wrote: >> On Tue, 9 Apr 2024 at 08:53, Michael Paquier wrote: >>> The thing is that you cannot rely on a lookup of the backend type for >>> the error information, or you open yourself to letting the caller of >>> pg_cancel_backend or pg_terminate_backend know if a backend is >>> controlled by a superuser or if a backend is an autovacuum worker. >> >> Good catch. Thanks. I think we need to update the error message to not >> leak backend type info. > > Yep, that's necessary I am afraid. Isn't it relatively easy to discover this same information today via pg_stat_progress_vacuum? That has the following code: /* Value available to all callers */ values[0] = Int32GetDatum(beentry->st_procpid); values[1] = ObjectIdGetDatum(beentry->st_databaseid); I guess I'm not quite following why we are worried about leaking whether a backend is an autovacuum worker. >>> The choice of pg_signal_autovacuum is a bit inconsistent, as well, >>> because autovacuum workers operate like regular backends. This name >>> can also be confused with the autovacuum launcher. >> >> Ok. What would be a good choice? Is `pg_signal_autovacuum_worker` good >> enough? > > Sounds fine to me. Perhaps others have an opinion about that? WFM -- Nathan Bossart Amazon Web Services: https://aws.amazon.com