Avoid reporting permission-denied publisher sequences as missing
Previously, if a sequence synchronization batch contained both a sequence
that had been dropped on the publisher and another for which the
replication role lacked SELECT privilege, the latter was reported
twice: once as a permission failure and again as missing on the
publisher.
This happened because the permission-denied sequence was not marked as
found on the publisher. As a result, when another sequence in the batch
was genuinely missing, the later missing-sequence check incorrectly
classified the permission-denied sequence as missing as well.
Fix this by marking the permission-denied sequence as found before
reporting the permission failure, so it is not later reported as
missing.
Reported-by: Noah Misch
Author: Vignesh C
Reviewed-by: Fujii Masao
Discussion: https://postgr.es/m/CALDaNm3LsUjW7PahuCsbYAxajSF+S328tw5E9rF0erdh7dKOXw@mail.gmail.com
Backpatch-through: 19
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/13b7a8a0ef56d9decae284b4983894175c17d217
Modified Files
--------------
src/backend/replication/logical/sequencesync.c | 20 ++++++++++++++++++--
1 file changed, 18 insertions(+), 2 deletions(-)