agora inbox for pgsql-committers@postgresql.org  
help / color / mirror / Atom feed
From: Álvaro Herrera <alvherre@kurilemu.de>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: REPACK: do not require REPLICATION or LOGIN
Date: Mon, 20 Apr 2026 13:50:14 +0000
Message-ID: <E1wEp0v-001rwZ-3B@gemulon.postgresql.org> (raw)

REPACK: do not require REPLICATION or LOGIN

Although REPACK (CONCURRENTLY) uses replication slots, there is no
concern that the slot will leak data of other users, because the
MAINTAIN privilege on the table is required anyway; requiring
REPLICATION is user-unfriendly without providing any actual protection.

A related aspect is that the REPLICATION attribute is not needed to
prevent REPACK from stealing slots from logical replication, since
commit e76d8c749c31 made REPACK use a separate pool of replication
slots.

Similarly, there's no reason to require that the table owner has the
LOGIN privilege.  Bypass the default behavior in the background worker
launch sequence.

Because there are now successful concurrent repack runs in the
regression tests, we're forced to run test_plan_advice under
wal_level=replica, so add that.  Also, move the cluster.sql test to a
different parallel group in parallel_schedule: apparently the use of the
repack worker causes it to exceed the maximum limit of processes in some
runs (the actual limit reached is the number of XIDs in a snapshot's xip
array).

Author: Antonin Houska <ah@cybertec.at>
Reported-by: Justin Pryzby <pryzby@telsasoft.com>
Reviewed-by: Chao Li <lic@highgo.com>
Discussion: https://postgr.es/m/aeJHPNmL4vVy3oPw@pryzbyj2023

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/5dbb63fc82b72ccc6f9e7be0361efdeee5deeb50

Modified Files
--------------
src/backend/commands/repack_worker.c                   |  6 +++---
.../modules/test_plan_advice/t/001_replan_regress.pl   |  1 +
src/test/regress/expected/cluster.out                  | 18 +++++++++++++++++-
src/test/regress/parallel_schedule                     |  4 ++--
src/test/regress/sql/cluster.sql                       |  9 ++++++++-
5 files changed, 31 insertions(+), 7 deletions(-)



Message-ID: <E1wEp0v-001rwZ-3B@gemulon.postgresql.org>
Permalink:  ../E1wEp0v-001rwZ-3B@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1wEp0v-001rwZ-3B@gemulon.postgresql.org

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: alvherre@kurilemu.de, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: REPACK: do not require REPLICATION or LOGIN
  In-Reply-To: <E1wEp0v-001rwZ-3B@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox