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 1s1qvz-00FPvv-HC for pgsql-hackers@arkaria.postgresql.org; Tue, 30 Apr 2024 17:06:27 +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 1s1qvw-007Ia4-SU for pgsql-hackers@arkaria.postgresql.org; Tue, 30 Apr 2024 17:06:25 +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 1s1qvw-007IZm-Ig for pgsql-hackers@lists.postgresql.org; Tue, 30 Apr 2024 17:06:25 +0000 Received: from mail-yb1-xb33.google.com ([2607:f8b0:4864:20::b33]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1s1qvu-000sVb-M3 for pgsql-hackers@lists.postgresql.org; Tue, 30 Apr 2024 17:06:24 +0000 Received: by mail-yb1-xb33.google.com with SMTP id 3f1490d57ef6-dc6dcd9124bso5969680276.1 for ; Tue, 30 Apr 2024 10:06:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=leadboat.com; s=google; t=1714496781; x=1715101581; darn=lists.postgresql.org; h=user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=NWN7LgIFo50ykTWYApuMPYbQ4UTCd/pMRgAaIkzSQ8k=; b=dSj61lj99VwM+iV82t8FjwzWzLjNu77qE17TMZM3Hc/qp37hUTCfdtdZOwu0odif6K gy0dTQOgraRp/Nw9OvXeKPsFuAtksIL+aLu/8h1muLwmycLaGP3X3Cgp+NSFYtua/mBI ah85oflCQTpm2Bi4D5c/IpfcmSCnZxcCG4Ey4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714496781; x=1715101581; h=user-agent:in-reply-to:content-transfer-encoding :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=NWN7LgIFo50ykTWYApuMPYbQ4UTCd/pMRgAaIkzSQ8k=; b=e337MqyximAcEQxMU7IJwoyc1W0vMea1y7FfMxDOSzjsfBIX/8/xeOIIvV6o5rc2iU 6SOnku3RyErCOl9dWzXQ9OqBdDL5nFVxFe08Ft8bxAJr+QPGR/0pSt8IC8zOFQh+SM/r 2s/rhpMDWMrd7fjUcTOyy1B1fTWASWCFqsYdp9C4RMhX7fNB8izkc125Ull4OKirtuIF nu5MnZz+UH9NiXifmd+FgDFhBVIAOhLZFIxdBxD0A47DmbtNoNm5Vg30hUqeqTkCzRC4 LnXgOAXLwItF9BmkPgV1PiCali6lLSZE3FEXvKL8bH9JkU+qlVzT5nuRSnnZaIKHqPGO t1Qg== X-Forwarded-Encrypted: i=1; AJvYcCX2XBrpLkFtHq/8vUESTvqYKUap6rYXh6pT9kYzOdZ3l+Z8sgXrDo1a5UY2Mi/QxSOte6oSQ9eSnLUBGt9vFDDxNqNh2TQ9zHy6v/Rip/1lmpTV X-Gm-Message-State: AOJu0YwI7iOaQ80EbUn6TSdg1UnhLgCL1GYqasr280km7wvNL3RdyG5x WAq80KnheTdZaYmpKJbLKm1wWluxJddBmpoUrwm3bOJ5nw/MyR4uN38aT4NfKjHrisydSb4NVN0 = X-Google-Smtp-Source: AGHT+IFc9xautas9JJS+0dfqd1nZ8uF3cXRnmICi/uqM3UfqQhsPZrZlbtkdkUIbdbA1DP842SCUmA== X-Received: by 2002:a05:6902:2202:b0:dcc:6d85:586a with SMTP id dm2-20020a056902220200b00dcc6d85586amr193964ybb.49.1714496780885; Tue, 30 Apr 2024 10:06:20 -0700 (PDT) Received: from google.com ([2600:1702:a20:5750::48]) by smtp.gmail.com with ESMTPSA id o9-20020a258109000000b00de5a4d73192sm2402441ybk.29.2024.04.30.10.06.19 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 30 Apr 2024 10:06:20 -0700 (PDT) Date: Tue, 30 Apr 2024 10:06:18 -0700 From: Noah Misch To: Amit Kapila Cc: Kirill Reshke , PostgreSQL Hackers Subject: Re: TerminateOtherDBBackends code comments inconsistency. Message-ID: <20240430170618.b3.nmisch@google.com> References: <20240422162639.68@rfd.leadboat.com> <20240429212756.60.nmisch@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/2.2.12 (2023-09-09) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, Apr 30, 2024 at 09:10:52AM +0530, Amit Kapila wrote: > On Tue, Apr 30, 2024 at 2:58 AM Noah Misch wrote: > > On Mon, Apr 29, 2024 at 10:18:35AM +0530, Amit Kapila wrote: > > > On Mon, Apr 22, 2024 at 9:56 PM Noah Misch wrote: > > > > > 3a9b18b309 didn't change the docs of pg_terminate_backend and whatever > > > is mentioned w.r.t permissions in the doc of that function sounds > > > valid for drop database force to me. Do you have any specific proposal > > > in your mind? > > > > Something like the attached. > > LGTM. > > > One could argue the function should also check > > isBackgroundWorker and ignore even bgworkers that set proc->roleId, but I've > > not done that. > > What is the argument for ignoring such workers? One of the proposed code comments says, "For bgworker authors, it's convenient to be able to recommend FORCE if a worker is blocking DROP DATABASE unexpectedly." That argument is debatable, but I do think it applies equally to bgworkers whether or not they set proc->roleId.