Don't retreat slot's confirmed_flush LSN.
authorAmit Kapila <[email protected]>
Mon, 19 May 2025 06:25:55 +0000 (11:55 +0530)
committerAmit Kapila <[email protected]>
Mon, 19 May 2025 06:25:55 +0000 (11:55 +0530)
commit7318f241d29c0b90e0b8b7e39ebd1914f68fd37a
tree58099e7114fc1a7a39d456a901bc8718dc1d53a8
parent5355a2400e847b1a7e7a3d9eea9516588d0fad91
Don't retreat slot's confirmed_flush LSN.

Prevent moving the confirmed_flush backwards, as this could lead to data
duplication issues caused by replicating already replicated changes.

This can happen when a client acknowledges an LSN it doesn't have to do
anything for, and thus didn't store persistently. After a restart, the
client can send the prior LSN that it stored persistently as an
acknowledgement, but we need to ignore such an LSN to avoid retreating
confirm_flush LSN.

Diagnosed-by: Zhijie Hou <[email protected]>
Author: shveta malik <[email protected]>
Reviewed-by: Amit Kapila <[email protected]>
Reviewed-by: Dilip Kumar <[email protected]>
Tested-by: Nisha Moond <[email protected]>
Backpatch-through: 13
Discussion: https://postgr.es/m/CAJpy0uDZ29P=BYB1JDWMCh-6wXaNqMwG1u1mB4=10Ly0x7HhwQ@mail.gmail.com
Discussion: https://postgr.es/m/OS0PR01MB57164AB5716AF2E477D53F6F9489A@OS0PR01MB5716.jpnprd01.prod.outlook.com
src/backend/replication/logical/logical.c