postgres/contrib/test_decoding/specs
Amit Kapila aaf9e95e87 Fix xmin advancement during fast_forward decoding.
During logical decoding, we advance catalog_xmin of logical too early in
fast_forward mode, resulting in required catalog data being removed by
vacuum. This mode is normally used to advance the slot without processing
the changes, but we still can't let the slot's xmin to advance to an
incorrect value.

Commit f49a80c481 fixed a similar issue where the logical slot's
catalog_xmin was getting advanced prematurely during non-fast-forward
mode. During xl_running_xacts processing, instead of directly advancing
the slot's xmin to the oldest running xid in the record, it allowed the
xmin to be held back for snapshots that can be used for
not-yet-replayed transactions, as those might consider older txns as
running too. However, it missed the fact that the same problem can happen
during fast_forward mode decoding, as we won't build a base snapshot in
that mode, and the future call to get_changes from the same slot can miss
seeing the required catalog changes leading to incorrect reslts.

This commit allows building the base snapshot even in fast_forward mode to
prevent the early advancement of xmin.

Reported-by: Amit Kapila <amit.kapila16@gmail.com>
Author: Zhijie Hou <houzj.fnst@fujitsu.com>
Reviewed-by: Masahiko Sawada <sawada.mshk@gmail.com>
Reviewed-by: shveta malik <shveta.malik@gmail.com>
Reviewed-by: Amit Kapila <amit.kapila16@gmail.com>
Backpatch-through: 13
Discussion: https://postgr.es/m/CAA4eK1LqWncUOqKijiafe+Ypt1gQAQRjctKLMY953J79xDBgAg@mail.gmail.com
Discussion: https://postgr.es/m/OS0PR01MB57163087F86621D44D9A72BF94BB2@OS0PR01MB5716.jpnprd01.prod.outlook.com
2025-04-28 11:35:54 +05:30
..
catalog_change_snapshot.spec Fix assertion failures while processing NEW_CID record in logical decoding. 2022-10-20 08:49:48 +05:30
concurrent_ddl_dml.spec Do more cleanup of isolation tests for test_decoding 2019-08-24 12:34:37 +09:00
concurrent_stream.spec Remove incidental md5() function uses from several tests 2023-07-04 14:31:57 +02:00
delayed_startup.spec Introduce logical decoding. 2014-03-03 16:32:18 -05:00
invalidation_distribution.spec Fix typo in test file name added in commit 4909b38af0. 2025-04-25 12:46:02 +05:30
mxact.spec Revert "Logical decoding of sequences" 2022-04-07 20:06:36 +02:00
oldest_xmin.spec Fix xmin advancement during fast_forward decoding. 2025-04-28 11:35:54 +05:30
ondisk_startup.spec Revert "Logical decoding of sequences" 2022-04-07 20:06:36 +02:00
skip_snapshot_restore.spec Fix typos and grammar in code comments and docs 2024-09-03 14:49:04 +09:00
slot_creation_error.spec Close race condition in slot_creation_error.spec. 2022-03-18 18:18:00 -07:00
snapshot_transfer.spec Introduce xid8-based functions to replace txid_XXX. 2020-04-07 12:04:32 +12:00
subxact_without_top.spec Stop demanding that top xact must be seen before subxact in decoding. 2020-02-19 08:15:49 +05:30
twophase_snapshot.spec Add option to enable two_phase commits via pg_create_logical_replication_slot. 2021-03-03 07:34:11 +05:30