Track conflict_reason in pg_replication_slots.

This patch changes the existing 'conflicting' field to 'conflict_reason'
in pg_replication_slots. This new field indicates the reason for the
logical slot's conflict with recovery. It is always NULL for physical
slots, as well as for logical slots which are not invalidated. The
non-NULL values indicate that the slot is marked as invalidated. Possible
values are:

wal_removed = required WAL has been removed.
rows_removed = required rows have been removed.
wal_level_insufficient = the primary doesn't have a wal_level sufficient
to perform logical decoding.

The existing users of 'conflicting' column can get the same answer by
using 'conflict_reason' IS NOT NULL.

Author: Shveta Malik
Reviewed-by: Amit Kapila, Bertrand Drouvot, Michael Paquier
Discussion: https://postgr.es/m/zyoe8iguqtbp-...@paquier.xyz

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/007693f2a3ac2ac19affcb03ad43cdb36ccff5b5

Modified Files
--------------
doc/src/sgml/system-views.sgml                     | 29 ++++++++-
src/backend/catalog/system_views.sql               |  2 +-
src/backend/replication/slotfuncs.c                | 22 +++++--
src/bin/pg_upgrade/info.c                          |  4 +-
src/include/catalog/catversion.h                   |  2 +-
src/include/catalog/pg_proc.dat                    |  4 +-
.../recovery/t/035_standby_logical_decoding.pl     | 72 ++++++++++++----------
src/test/regress/expected/rules.out                |  4 +-
8 files changed, 90 insertions(+), 49 deletions(-)

Reply via email to