We were directly copying the LSN locations while syncing the slots on the standby. Now, it is possible that at some particular restart_lsn there are some running xacts, which means if we start reading the WAL from that location after promotion, we won't reach a consistent snapshot state at that point. However, on the primary, we would have already been in a consistent snapshot state at that restart_lsn so we would have just serialized the existing snapshot. To avoid this problem we will use the advance_slot functionality unless the snapshot already exists at the synced restart_lsn location. This will help us to ensure that snapbuilder/slot statuses are updated properly without generating any changes. Note that the synced slot will remain as RS_TEMPORARY till the decoding from corresponding restart_lsn can reach a consistent snapshot state after which they will be marked as RS_PERSISTENT. Per buildfarm Author: Hou Zhijie Reviewed-by: Bertrand Drouvot, Shveta Malik, Bharath Rupireddy, Amit Kapila Discussion: https://postgr.es/m/OS0PR01MB5716B3942AE49F3F725ACA92943B2@OS0PR01MB5716.jpnprd01.prod.outlook.com |
||
---|---|---|
.. | ||
t | ||
.gitignore | ||
Makefile | ||
README | ||
meson.build |
README
src/test/recovery/README Regression tests for recovery and replication ============================================= This directory contains a test suite for recovery and replication. Running the tests ================= NOTE: You must have given the --enable-tap-tests argument to configure. Also, to use "make installcheck", you must have built and installed contrib/pg_prewarm, contrib/pg_stat_statements and contrib/test_decoding in addition to the core code. Run make check or make installcheck You can use "make installcheck" if you previously did "make install". In that case, the code in the installation tree is tested. With "make check", a temporary installation tree is built from the current sources and then tested. Either way, this test initializes, starts, and stops several test Postgres clusters. If you want to test WAL consistency checking, add PG_TEST_EXTRA=wal_consistency_checking to the "make" command. This is resource-intensive, so it's not done by default. See src/test/perl/README for more info about running these tests.