Thread: pgsql: Fix the intermittent buildfarm failures in 040_standby_failover_
Fix the intermittent buildfarm failures in 040_standby_failover_slots_sync. It is possible that even if the primary waits for the subscriber to catch up and then disables the subscription, the XLOG_RUNNING_XACTS record gets inserted between the two steps by bgwriter and walsender processes it. This can move the restart_lsn of the corresponding slot in an unpredictable way which further leads to slot sync failure. To ensure predictable behaviour, we drop the subscription and manually create the slot before the test. The other idea we discussed to write a predictable test is to use injection points to control the bgwriter logging XLOG_RUNNING_XACTS but that needs more analysis. We can add a separate test using injection points. Per buildfarm Author: Hou Zhijie Reviewed-by: Amit Kapila, Shveta Malik Discussion: https://postgr.es/m/CAA4eK1JD8h_XLRsK_o_Xh=5MhTzm+6d4Cb4_uPgFJ2wSQDah=g@mail.gmail.com Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/6f3d8d5e7cc2f2e2367cd6da6f8affe98d1f5729 Modified Files -------------- .../recovery/t/040_standby_failover_slots_sync.pl | 62 +++++++++------------- 1 file changed, 24 insertions(+), 38 deletions(-)