pgsql: Stabilize recently added tests in 051_effective_wal_level.pl.

From: Masahiko Sawada <msawada(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Stabilize recently added tests in 051_effective_wal_level.pl.
Date: 2026-10-08 17:33:51
Message-ID: E1xEs07-00000000qBc-3gtp@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Stabilize recently added tests in 051_effective_wal_level.pl.

Commit 1f2245371e3 added a test for the case where logical decoding
is disabled and re-enabled while synchronizing a replication slot. Its
cleanup assumed the slot re-created on retry would still be temporary,
and so would be gone once the corresponding remote slot was
dropped. That isn't guaranteed: the catalog_xmin reserved on the
standby is not necessarily ahead of the remote slot's. In that case
the slot is persisted on the first retry, and the subsequent logical
decoding deactivation invalidates it on the standby rather than
dropping it, so the check that no synced slot is left behind fails.

Stabilize the cleanup by calling an extra pg_sync_replication_slots()
after dropping the remote slot and before disabling logical decoding on
the primary.

Per buildfarm member skink.

Reported-by: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Suggested-by: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Reviewed-by: shveta malik <shveta(dot)malik(at)gmail(dot)com>
Discussion: https://postgr.es/m/CAHGQGwFWXASACRnhHJgEdk8nWyLw4bLLDhiEiKSqBqd+tzJ2Pg@mail.gmail.com
Backpatch-through: 19

Branch
------
REL_19_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/d53e54f5e53ce77f283d911fe31b80915732a600

Modified Files
--------------
src/test/recovery/t/051_effective_wal_level.pl | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Andrew Dunstan 2026-10-08 17:41:25 pgsql: COPY TO FORMAT JSON: use the query's column names as keys
Previous Message Masahiko Sawada 2026-10-08 17:33:47 pgsql: Stabilize recently added tests in 051_effective_wal_level.pl.