Re: Fix the race condition for updating slot minimum LSN
solai v <solai.cdac@gmail.com>
From: solai v <solai.cdac@gmail.com>
To: surya poondla <suryapoondla4@gmail.com>
Cc: "Zhijie Hou (Fujitsu)" <houzj.fnst@fujitsu.com>, Postgres hackers <pgsql-hackers@lists.postgresql.org>, "Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>,
Amit Kapila <amit.kapila16@gmail.com>
Date: 2026-05-15T04:43:25Z
Lists: pgsql-hackers
Hi Hou zj, I tested the patch on a local debug build.The patch applied cleanly and postgreSQL built successfully without issues. I tested logical slot creation,WAL switching,slot advancement,and checkpoints after applying the patch,and everything worked as expected without crashes or assertion failures. I also reviewed the changes in slot.c and slotsync.c .The locking approach around restart_lsn updates and minimum LSN computation looks reasonable to me and seems consistent with the existing xmin synchronization logic. Surya's explanation regarding copy_replication_slot() also makes sense to me after reviewing that patch. Regards, Solai