Stabilize 035_standby_logical_decoding.pl.
authorAmit Kapila <akapila@postgresql.org>
Tue, 8 Apr 2025 04:08:02 +0000 (09:38 +0530)
committerAmit Kapila <akapila@postgresql.org>
Tue, 8 Apr 2025 04:08:02 +0000 (09:38 +0530)
commit105b2cb336173d7c62e26ad104682175ddad4cff
treeb60314b0bdb3601db984a7e12d4a4b4cc00f4fe0
parent46b4ba533cee9f64a60714d91607e74362abf67f
Stabilize 035_standby_logical_decoding.pl.

Some tests try to invalidate logical slots on the standby server by
running VACUUM on the primary. The problem is that xl_running_xacts was
getting generated and replayed before the VACUUM command, leading to the
advancement of the active slot's catalog_xmin. Due to this, active slots
were not getting invalidated, leading to test failures.

We fix it by skipping the generation of xl_running_xacts for the required
tests with the help of injection points. As the required interface for
injection points was not present in back branches, we fixed the failing
tests in them by disallowing the slot to become active for the required
cases (where rows_removed conflict could be generated).

Author: Hayato Kuroda <kuroda.hayato@fujitsu.com>
Reviewed-by: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Reviewed-by: Amit Kapila <amit.kapila16@gmail.com>
Backpatch-through: 16, where it was introduced
Discussion: https://postgr.es/m/Z6oQXc8LmiTLfwLA@ip-10-97-1-34.eu-west-3.compute.internal
src/backend/storage/ipc/standby.c
src/test/recovery/t/035_standby_logical_decoding.pl