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 1v8sKS-006IGg-Pd for pgsql-hackers@arkaria.postgresql.org; Wed, 15 Oct 2025 03:37:32 +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 1v8sKR-004MVv-Fg for pgsql-hackers@arkaria.postgresql.org; Wed, 15 Oct 2025 03:37:30 +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 1v8sKR-004MVm-2O for pgsql-hackers@lists.postgresql.org; Wed, 15 Oct 2025 03:37:30 +0000 Received: from mail-pj1-x102c.google.com ([2607:f8b0:4864:20::102c]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1v8sKN-002F48-0X for pgsql-hackers@postgresql.org; Wed, 15 Oct 2025 03:37:29 +0000 Received: by mail-pj1-x102c.google.com with SMTP id 98e67ed59e1d1-33292adb180so5891664a91.3 for ; Tue, 14 Oct 2025 20:37:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1760499445; x=1761104245; darn=postgresql.org; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:from:to:cc:subject:date:message-id:reply-to; bh=5dEQRcVfFeC/D57Z9XEr3YQAso3V8L1cQ5JnLeUra+k=; b=CMhO9nGTmfqsjsw42DcarGrJV6W2IUtaAoZJhI/adB17YFcTj14TAkp0K4dxCWj+Aj c6egi6/hSdd7w90Us01e63ErcWFIPh5FdCKIl/rp+9AKVMVgiMFxyuXElQpx4uVW2EoF FT7hl0dPCJCncKb4J3FPDBBsUirLkPFBui4A02LJi4jxUFMHIDY/pvuK4MVmvUejPYI3 bIHkqL8Jb1wXut/83qfA4gdLlw/n5t+xGiCIFhIcxGCUvL4itHexvpW9o5+3BeGM0Fbw TdN9s/PfQzKNwq9pQAk5aW6a+zE+qC5T2lUsMMZo9qIGWMRUVwdl6gXutnv+V9U/7e7R vk4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1760499445; x=1761104245; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=5dEQRcVfFeC/D57Z9XEr3YQAso3V8L1cQ5JnLeUra+k=; b=eqCP/kZActzY64VSEcFhNmGbDyIVlLG3gnmnIGFiJADoYAwBes4xiC76TaV0tHtyHz /6+/Dsq2avquw1GRYiskQyNpPPRsAk4I+XfQ+WsdvqcseAcwTKthYqpRbLfnxS/rG1sP dVpXwqSKTo1CRfYw40wh9jIHlyTlxp1KPwyOE1RRNhXkHok1cTtLLeZTDSUw+K+4T1nj M36QuL/AAGSEQCJmddzDyipxMpbK3ET39IHfFX4ceZXJ3KFn2rCD1F4RO36tbUuS35SW EOiBZ48/fcrJCOSDelzrWCPYMwNRNIA3D1O9qUMn050hdC5ATY0J970mG8RH+YfqVQIk JhGw== X-Forwarded-Encrypted: i=1; AJvYcCVZFUMSQv2tot85dgkzs1XWdzL1JMCQ/02VZnQGijJJXTDMyxgjRiT6QfWXT4ndKcsyocf5cn0K4IymBMFi@postgresql.org X-Gm-Message-State: AOJu0YzAyYtkjj37MUH1bSS0d0CaR1PRPl5Ejxw8gcsHrqU2vj0rGjgm io2wrTp9U3hFk+kDDc+C+TnVz7EWo0G0Tlu31ENgWJSoJUK/LkR3Dp0c X-Gm-Gg: ASbGnctEr/GQ5uKl2jHOCtWOccq8+yTcVfxdR0zzQUtrJavJ1PNYbkBxQ7+OAj/NpVj jhTo1ED05AhCtaopz7qFaYLKjLnJbKY7/PGKHJ/wc08Dj+vpkjfWwLc91bhvLW5+8951ArKNDtS mQDt6KEBrXSgParXi0sqQdmwXs9XUbOrUpPQJ2dDEAoieBgjMyVVlFf4EdmDPATjqiFkjwo192u 6xeuOvnPcWUUsWP96DmPjzCNX5H1oVo66V3IkWyjoK0fyLb+iRl6gnXgem/wAAA/H9Mvo454++6 UCO3Sg2lTFn05b881BltYeMFkdGles3SKzGXW0L7xoY6bVqiTTNt7wzNd3DvgLx4wLXVOiLUdkM 1+UureWHaaeXpM55/6jbWPTiZG5oGZugd6VfsdAVQf20dOr6/mOiwDgaZ7yCUgFw= X-Google-Smtp-Source: AGHT+IG47yEkFfHLDVja+aRKBuXhDHFPW4cGNUpjRiIp+pPsXWXDLGpopn3NB8CIOjSLKD9eD5oOsA== X-Received: by 2002:a17:90b:1b50:b0:32d:a0f7:fa19 with SMTP id 98e67ed59e1d1-33b51375940mr41286295a91.17.1760499445208; Tue, 14 Oct 2025 20:37:25 -0700 (PDT) Received: from smtpclient.apple ([170.178.170.211]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-33b61aab6eesm17881804a91.15.2025.10.14.20.37.19 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Oct 2025 20:37:24 -0700 (PDT) From: Chao Li Message-Id: <468D0F1F-1959-4FEC-A16D-C3B3AB7C8730@gmail.com> Content-Type: multipart/alternative; boundary="Apple-Mail=_41E9A7D0-87E1-4259-B35E-AF496C835B3E" Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.700.81\)) Subject: Re: [PROPOSAL] Termination of Background Workers for ALTER/DROP DATABASE Date: Wed, 15 Oct 2025 11:37:05 +0800 In-Reply-To: Cc: Peter Smith , "Hayato Kuroda (Fujitsu)" , Michael Paquier , pgsql-hackers To: "Aya Iwata (Fujitsu)" References: X-Mailer: Apple Mail (2.3826.700.81) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --Apple-Mail=_41E9A7D0-87E1-4259-B35E-AF496C835B3E Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Oct 10, 2025, at 17:04, Aya Iwata (Fujitsu) = wrote: >=20 >> 3 - bgworker.h >> ``` >> +extern void TerminateBackgroundWorkersByOid(Oid databaseId); >> ``` >>=20 >> An OID can represent a lot of things. So, instead of suggesting the = OID type by parameter name, I wonder if it is better do that with the = function name, like TerminateBgWorkersByDbOid(Oid oid) >=20 > After receiving your comment, I checked other functions and there is = no other examples like XXOid function in the code. > If this function use only here, original code is using databaseId in = argument and it clear what Oid is. > I think original name is fine because it's not a function that's = called much elsewhere. By searching for =E2=80=9CByOid=E2=80=9D, we can get some existing = examples: ObjectAddress RefreshMatViewByOid(Oid matviewOid, bool is_create, bool skipData, bool concurrent, const char *queryString, QueryCompletion *qc) The function name clearly tells refresh MatView by Oid, so the oid in = parameter is an old of mat view. ResultRelInfo * ExecLookupResultRelByOid(ModifyTableState *node, Oid resultoid, bool missing_ok, bool update_cache) The function name indicates ResultRel, so the oid is a result oid. AccessMethodInfo * findAccessMethodByOid(Oid oid) The function name tells to find access method, the the oid is an access = method=E2=80=99s OID. You can find more =E2=80=A6 But in this patch, the function name only indeeds =E2=80=9Cterminate = background workers=E2=80=9D, while the oid is a database oid. Maybe we = can rename the function to =E2=80=9CTerminateDatabaseBgWorkersByOid()=E2=80= =9D. Best regards, -- Chao Li (Evan) HighGo Software Co., Ltd. https://www.highgo.com/ --Apple-Mail=_41E9A7D0-87E1-4259-B35E-AF496C835B3E Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8

On Oct 10, 2025, at 17:04, Aya Iwata (Fujitsu) = <iwata.aya@fujitsu.com> wrote:

3 - = bgworker.h
```
+extern void TerminateBackgroundWorkersByOid(Oid = databaseId);
```

An OID can represent a lot of things. So, = instead of suggesting the OID type by parameter name, I wonder if it is = better do that with the function name, like = TerminateBgWorkersByDbOid(Oid oid)

After receiving your comment, I checked = other functions and there is no other examples like XXOid function in = the code.
If this function use = only here, original code is using databaseId in argument and it clear = what Oid is.
I think original name is = fine because it's not a function that's called much = elsewhere.

By = searching for =E2=80=9CByOid=E2=80=9D, we can get some existing = examples:

ObjectAddress
RefreshMatViewByOid(Oid = matviewOid, bool is_create, bool = skipData,
= bool concurrent, const char *queryString,
QueryCompletion *qc)

The function name clearly tells refresh MatView = by Oid, so the oid in parameter is an old of mat = view.

ResultRelInfo *
ExecLookupResultRelByOid(ModifyTableState *node, = Oid resultoid,
bool missing_ok, bool update_cache)

The function name = indicates ResultRel, so the oid is a result = oid.

AccessMethodInfo *
findAccessMethodByOid(Oid = oid)

The = function name tells to find access method, the the oid is an access = method=E2=80=99s OID.

You can find more = =E2=80=A6

But in this patch, the function name = only indeeds =E2=80=9Cterminate background workers=E2=80=9D, while the = oid is a database oid. Maybe we can rename the function to = =E2=80=9CTerminateDatabaseBgWorkersByOid()=E2=80=9D.

<= div>Best regards,
--
Chao Li (Evan)
HighGo = Software Co., = Ltd.
https://www.highgo.com/




= --Apple-Mail=_41E9A7D0-87E1-4259-B35E-AF496C835B3E--