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
PostgreSQL Database Management System
This directory contains the source code distribution of the PostgreSQL database management system.
PostgreSQL is an advanced object-relational database management system that supports an extended subset of the SQL standard, including transactions, foreign keys, subqueries, triggers, user-defined types and functions. This distribution also contains C language bindings.
Copyright and license information can be found in the file COPYRIGHT.
General documentation about this version of PostgreSQL can be found at https://www.postgresql.org/docs/devel/. In particular, information about building PostgreSQL from the source code can be found at https://www.postgresql.org/docs/devel/installation.html.
The latest version of this software, and related software, may be obtained at https://www.postgresql.org/download/. For more information look at our web site located at https://www.postgresql.org/.