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.96) (envelope-from ) id 1vcryq-00Bg36-2H for pgsql-hackers@arkaria.postgresql.org; Mon, 05 Jan 2026 21:19:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vcryo-004E3z-0g for pgsql-hackers@arkaria.postgresql.org; Mon, 05 Jan 2026 21:19:10 +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.96) (envelope-from ) id 1vcryn-004E3q-2o for pgsql-hackers@lists.postgresql.org; Mon, 05 Jan 2026 21:19:10 +0000 Received: from mail-qt1-x830.google.com ([2607:f8b0:4864:20::830]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vcryl-004kZw-35 for pgsql-hackers@postgresql.org; Mon, 05 Jan 2026 21:19:10 +0000 Received: by mail-qt1-x830.google.com with SMTP id d75a77b69052e-4ed66b5abf7so24902041cf.1 for ; Mon, 05 Jan 2026 13:19:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1767647946; x=1768252746; darn=postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=01QDvIacRGa8WuwWsTCFmsBCnNtfxwd5RaRYbB+narE=; b=gSiHyseTtyFr2hP8No/lSvRh/Fj5DdLwV7i7mfKA06nhfcljD1Y/KxGAILBhA2G2ra S3qLMnL2ewF424xwff22c9JSlblvcSKFxMDGe/zFiZOswMveWHXAnfy0naZQutpK2Rqv zfFtdTvGL/7znp3+FTIeDmzxnEmTxxuIuFgHgrflGnnsc7asrBcDLc6QEUbUfXtgXJiD lymrbIqIePk6v+vvugnwgM8RQ/4hY3QJZV12IjEfwb6dyxMCa7tfVQpUIWV5IeUIaOIa Z+XvGUS6I0GbZ19LascewS48WNKTRqpk/ZKGVKBfqTB2OZpatHDzqY/xAkpmCjRlv3EF oKyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767647946; x=1768252746; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=01QDvIacRGa8WuwWsTCFmsBCnNtfxwd5RaRYbB+narE=; b=A1cgVhkPsf/32VCpt0mJBIN8DP4Vf000fgT8tZLG4Rod4krdPMNX5MOUxUMrq6krvE SOjMApH6fB5eemgTAKAClfNG9m6oQ7xlFUE2yBGeD+R6Q4yIuMBM9KVG3QL8WZT5XJ8e 0X0oarA+Nvx26W53Co3Pt09O+1IOnQteNMSjtJ61jEcFuZJkn3mSFxlmmAx5xuxoZ0x/ K2rHNDZcdPGi8eghzewMxi+iBfASSuHbfrdmj5XkB6nu0IaczmQZUITcYJuv4CrZtVK4 lxLAembHOagICYZu1ggKC9XyvVSp8YaBclz5Y5Qi3AHR0yoNfTvTctNBDvWu8ihUwgbN DXOg== X-Forwarded-Encrypted: i=1; AJvYcCVH6NWvllPUD9VoCcfTA6NKH5bLrkR8QU4PsjAl86d6FWi3CC6F77VJ9of7qOpoCUM8TRczKVtLWIUmNcQ1@postgresql.org X-Gm-Message-State: AOJu0YxJCpO/xXi/BTAv6ilEzHJ2dxngHdCwD0G9YNl8LirHN+nerFHX H8mIVOuKee/Snh9MrU7XPKAxDfk3Zaa8hnJWcHQ2xJX40QfHHA+Rt+oQRdvy2SCRo6WxXf1mGKm 30K3EUBlHpBIM047DKWt+0Z8UghvOUVQ= X-Gm-Gg: AY/fxX7XZdJksa1GEuIQM5mpokpNdDp5JQ71wnOSPDFNaZEXM50/YGt1AqfXH/6J/P9 nI69dgfiN9TuOiIw/QmnOCrrz8uV5svEBa9VBmaQ2G+0TSCKluZ+NrgYC+taQ8+40tVD2gyHpKr vWhskfLYxlyFKRiipXY14EeCshqOi7oVoa49usc2ClsUZnwPTIwzK0PoIMeI1S0DWf70klkKgpP AWLWuQhILQaJ9kioChUwV/QB6bwgB2PQYCgJKuc4AOHiRQqNRuKO5kXUnjf6O4s43N1h10mY15j othnK+JsD20YJyQkdqU/suHZ1451MUTC3QhpaNat X-Google-Smtp-Source: AGHT+IHUZaLDGa9izcGKkB+NybBM3JeqKwcKhVorNngMHHw6vjvXVzFY9MVuumRVswNrRfKnuDYeIflLhyDlrneMZ1A= X-Received: by 2002:a05:622a:5815:b0:4f1:8bfe:e445 with SMTP id d75a77b69052e-4ffa8511c4amr8935081cf.40.1767647945982; Mon, 05 Jan 2026 13:19:05 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Peter Smith Date: Tue, 6 Jan 2026 08:18:39 +1100 X-Gm-Features: AQt7F2q6kfcLiPRSjbZueW10Vl_j3PL8rhidYKNio0QK4_-M9U5S4HKWUByeAI0 Message-ID: Subject: Re: [PROPOSAL] Termination of Background Workers for ALTER/DROP DATABASE To: "Aya Iwata (Fujitsu)" Cc: Michael Paquier , Pavel Stehule , Chao Li , "Hayato Kuroda (Fujitsu)" , pgsql-hackers Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, Jan 6, 2026 at 2:06=E2=80=AFAM Aya Iwata (Fujitsu) wrote: > > Hi > > Thank you for your comments and suggestions on the previous version patch= es! > I believe this feature become much better. > > I've created a v13 patch incorporating Peter-san's suggestions. > Some review comments for v13-0001. =3D=3D=3D=3D=3D=3D src/backend/storage/ipc/procarray.c CountOtherDBBackends: 1. * If there are other backends in the DB, we will wait a maximum of 5 seco= nds - * for them to exit. Autovacuum backends are encouraged to exit early by - * sending them SIGTERM, but normal user backends are just waited for. + * for them to exit. Autovacuum backends and background workers are encou= raged + * to exit early by sending them PMSIGNAL_BACKGROUND_WORKER_CHANGE, but no= rmal + * user backends are just waited for. This did not seem like the correct fix for my previous review comment [1, comment #3], because the autovacuum backends are still killed with SIGTERM, right? =3D=3D=3D=3D=3D=3D .../worker_spi/t/002_worker_terminate.pl 2. +# Confirm that the non-interruptible bgworker is still running. +my $result =3D $node->safe_psql( + "postgres", qq( + SELECT count(1) FROM pg_stat_activity + WHERE backend_type =3D 'worker_spi dynamic';)); The indentation of the "SELECT" still does not look correct to me. Did you run pgperltidy on this file? =3D=3D=3D=3D=3D=3D [1] https://www.postgresql.org/message-id/CAHut%2BPtSVYKU4vfaRev4FMdbeZ3ukv= xRy4X7uK05jv_9WMYafA%40mail.gmail.com Kind Regards, Peter Smith. Fujitsu Australia