pgsql: Replace PGPROC.isBackgroundWorker with isRegularBackend.

2024-12-28 Thread Tom Lane
Replace PGPROC.isBackgroundWorker with isRegularBackend. Commit 34486b609 effectively redefined isBackgroundWorker as meaning "not a regular backend", whereas before it had the narrower meaning of AmBackgroundWorkerProcess(). For clarity, rename the field to isRegularBackend and invert its sense.

pgsql: Exclude parallel workers from connection privilege/limit checks.

2024-12-28 Thread Tom Lane
Exclude parallel workers from connection privilege/limit checks. Cause parallel workers to not check datallowconn, rolcanlogin, and ACL_CONNECT privileges. The leader already checked these things (except for rolcanlogin which might have been checked for a different role). Re-checking can accompl

pgsql: Exclude parallel workers from connection privilege/limit checks.

2024-12-28 Thread Tom Lane
Exclude parallel workers from connection privilege/limit checks. Cause parallel workers to not check datallowconn, rolcanlogin, and ACL_CONNECT privileges. The leader already checked these things (except for rolcanlogin which might have been checked for a different role). Re-checking can accompl

pgsql: Exclude parallel workers from connection privilege/limit checks.

2024-12-28 Thread Tom Lane
Exclude parallel workers from connection privilege/limit checks. Cause parallel workers to not check datallowconn, rolcanlogin, and ACL_CONNECT privileges. The leader already checked these things (except for rolcanlogin which might have been checked for a different role). Re-checking can accompl

pgsql: Exclude parallel workers from connection privilege/limit checks.

2024-12-28 Thread Tom Lane
Exclude parallel workers from connection privilege/limit checks. Cause parallel workers to not check datallowconn, rolcanlogin, and ACL_CONNECT privileges. The leader already checked these things (except for rolcanlogin which might have been checked for a different role). Re-checking can accompl

pgsql: Exclude parallel workers from connection privilege/limit checks.

2024-12-28 Thread Tom Lane
Exclude parallel workers from connection privilege/limit checks. Cause parallel workers to not check datallowconn, rolcanlogin, and ACL_CONNECT privileges. The leader already checked these things (except for rolcanlogin which might have been checked for a different role). Re-checking can accompl

pgsql: Exclude parallel workers from connection privilege/limit checks.

2024-12-28 Thread Tom Lane
Exclude parallel workers from connection privilege/limit checks. Cause parallel workers to not check datallowconn, rolcanlogin, and ACL_CONNECT privileges. The leader already checked these things (except for rolcanlogin which might have been checked for a different role). Re-checking can accompl

pgsql: Try to avoid semaphore-related test failures on NetBSD/OpenBSD.

2024-12-28 Thread Tom Lane
Try to avoid semaphore-related test failures on NetBSD/OpenBSD. These two platforms have a remarkably tight default limit on the number of SysV semaphores in the system: SEMMNS is only 60 out-of-the-box. Unless manual action is taken to raise that, we'll only be able to allocate 3 sets of 16 usab

pgsql: Reserve a PGPROC slot and semaphore for the slotsync worker proc

2024-12-28 Thread Tom Lane
Reserve a PGPROC slot and semaphore for the slotsync worker process. The need for this was missed in commit 93db6cbda, with the result being that if we launch a slotsync worker it would consume one of the PGPROCs in the max_connections pool. That could lead to inability to launch the worker, or t

pgsql: Reserve a PGPROC slot and semaphore for the slotsync worker proc

2024-12-28 Thread Tom Lane
Reserve a PGPROC slot and semaphore for the slotsync worker process. The need for this was missed in commit 93db6cbda, with the result being that if we launch a slotsync worker it would consume one of the PGPROCs in the max_connections pool. That could lead to inability to launch the worker, or t

pgsql: In REASSIGN OWNED of a database, lock the tuple as mandated.

2024-12-28 Thread Noah Misch
In REASSIGN OWNED of a database, lock the tuple as mandated. Commit aac2c9b4fde889d13f859c233c2523345e72d32b mandated such locking and attempted to fulfill that mandate, but it missed REASSIGN OWNED. Hence, it remained possible to lose VACUUM's inplace update of datfrozenxid if a REASSIGN OWNED pr

pgsql: In REASSIGN OWNED of a database, lock the tuple as mandated.

2024-12-28 Thread Noah Misch
In REASSIGN OWNED of a database, lock the tuple as mandated. Commit aac2c9b4fde889d13f859c233c2523345e72d32b mandated such locking and attempted to fulfill that mandate, but it missed REASSIGN OWNED. Hence, it remained possible to lose VACUUM's inplace update of datfrozenxid if a REASSIGN OWNED pr

pgsql: In REASSIGN OWNED of a database, lock the tuple as mandated.

2024-12-28 Thread Noah Misch
In REASSIGN OWNED of a database, lock the tuple as mandated. Commit aac2c9b4fde889d13f859c233c2523345e72d32b mandated such locking and attempted to fulfill that mandate, but it missed REASSIGN OWNED. Hence, it remained possible to lose VACUUM's inplace update of datfrozenxid if a REASSIGN OWNED pr

pgsql: In REASSIGN OWNED of a database, lock the tuple as mandated.

2024-12-28 Thread Noah Misch
In REASSIGN OWNED of a database, lock the tuple as mandated. Commit aac2c9b4fde889d13f859c233c2523345e72d32b mandated such locking and attempted to fulfill that mandate, but it missed REASSIGN OWNED. Hence, it remained possible to lose VACUUM's inplace update of datfrozenxid if a REASSIGN OWNED pr

pgsql: In REASSIGN OWNED of a database, lock the tuple as mandated.

2024-12-28 Thread Noah Misch
In REASSIGN OWNED of a database, lock the tuple as mandated. Commit aac2c9b4fde889d13f859c233c2523345e72d32b mandated such locking and attempted to fulfill that mandate, but it missed REASSIGN OWNED. Hence, it remained possible to lose VACUUM's inplace update of datfrozenxid if a REASSIGN OWNED pr

pgsql: In REASSIGN OWNED of a database, lock the tuple as mandated.

2024-12-28 Thread Noah Misch
In REASSIGN OWNED of a database, lock the tuple as mandated. Commit aac2c9b4fde889d13f859c233c2523345e72d32b mandated such locking and attempted to fulfill that mandate, but it missed REASSIGN OWNED. Hence, it remained possible to lose VACUUM's inplace update of datfrozenxid if a REASSIGN OWNED pr