Fix the missing table sync due to improper invalidation handling.
authorAmit Kapila <akapila@postgresql.org>
Thu, 25 Apr 2024 05:03:04 +0000 (10:33 +0530)
committerAmit Kapila <akapila@postgresql.org>
Thu, 25 Apr 2024 05:03:04 +0000 (10:33 +0530)
commit28a8cc457b022a68b01ae0c12fba73ad16764ec4
treec457cc8f2cfd74f5d8cebca7b7692fe0a5e6d6e1
parent5e85bc3b0189d01734dcda49e26bd32aff46bcf2
Fix the missing table sync due to improper invalidation handling.

We missed performing table sync if the invalidation happened while the
non-ready tables list was being prepared. This occurs because the sync
state was set to valid at the end of non-ready table list preparation
irrespective of the invalidations processed while the list is being
prepared.

Fix it by changing the boolean variable to a tri-state enum and by setting
table state to valid only if no invalidations have occurred while the list
is being prepared.

Reprted-by: Alexander Lakhin
Diagnosed-by: Alexander Lakhin
Author: Vignesh C
Reviewed-by: Hou Zhijie, Alexander Lakhin, Ajin Cherian, Amit Kapila
Backpatch-through: 15
Discussion: https://postgr.es/m/711a6afe-edb7-1211-cc27-1bef8239eec7@gmail.com
src/backend/replication/logical/tablesync.c
src/tools/pgindent/typedefs.list