diff options
author | Amit Kapila <akapila@postgresql.org> | 2024-03-22 13:52:05 +0530 |
---|---|---|
committer | Amit Kapila <akapila@postgresql.org> | 2024-03-22 13:52:05 +0530 |
commit | 6ae701b4378db2284c77314560e95a93d0ba9484 (patch) | |
tree | 8490c11526b9b13777a5e13fbdab2e1e2b45c8d9 /doc/src | |
parent | b4080fa3dcf6c6359e542169e0e81a0662c53ba8 (diff) | |
download | postgresql-6ae701b4378db2284c77314560e95a93d0ba9484.tar.gz postgresql-6ae701b4378db2284c77314560e95a93d0ba9484.zip |
Track invalidation_reason in pg_replication_slots.
Till now, the reason for replication slot invalidation is not tracked
directly in pg_replication_slots. A recent commit 007693f2a3 added
'conflict_reason' to show the reasons for slot conflict/invalidation, but
only for logical slots.
This commit adds a new column 'invalidation_reason' to show invalidation
reasons for both physical and logical slots. And, this commit also turns
'conflict_reason' text column to 'conflicting' boolean column (effectively
reverting commit 007693f2a3). The 'conflicting' column is true for
invalidation reasons 'rows_removed' and 'wal_level_insufficient' because
those make the slot conflict with recovery. When 'conflicting' is true,
one can now look at the new 'invalidation_reason' column for the reason
for the logical slot's conflict with recovery.
The new 'invalidation_reason' column will also be useful to track other
invalidation reasons in the future commit.
Author: Bharath Rupireddy
Reviewed-by: Bertrand Drouvot, Amit Kapila, Shveta Malik
Discussion: https://www.postgresql.org/message-id/ZfR7HuzFEswakt/a%40ip-10-97-1-34.eu-west-3.compute.internal
Discussion: https://www.postgresql.org/message-id/CALj2ACW4aUe-_uFQOjdWCEN-xXoLGhmvRFnL8SNw_TZ5nJe+aw@mail.gmail.com
Diffstat (limited to 'doc/src')
-rw-r--r-- | doc/src/sgml/ref/pgupgrade.sgml | 4 | ||||
-rw-r--r-- | doc/src/sgml/system-views.sgml | 25 |
2 files changed, 20 insertions, 9 deletions
diff --git a/doc/src/sgml/ref/pgupgrade.sgml b/doc/src/sgml/ref/pgupgrade.sgml index 58c6c2df8b8..8de52bf7527 100644 --- a/doc/src/sgml/ref/pgupgrade.sgml +++ b/doc/src/sgml/ref/pgupgrade.sgml @@ -453,8 +453,8 @@ make prefix=/usr/local/pgsql.new install <para> All slots on the old cluster must be usable, i.e., there are no slots whose - <link linkend="view-pg-replication-slots">pg_replication_slots</link>.<structfield>conflict_reason</structfield> - is not <literal>NULL</literal>. + <link linkend="view-pg-replication-slots">pg_replication_slots</link>.<structfield>conflicting</structfield> + is not <literal>true</literal>. </para> </listitem> <listitem> diff --git a/doc/src/sgml/system-views.sgml b/doc/src/sgml/system-views.sgml index be90edd0e20..b5da476c206 100644 --- a/doc/src/sgml/system-views.sgml +++ b/doc/src/sgml/system-views.sgml @@ -2525,13 +2525,24 @@ SELECT * FROM pg_locks pl LEFT JOIN pg_prepared_xacts ppx <row> <entry role="catalog_table_entry"><para role="column_definition"> - <structfield>conflict_reason</structfield> <type>text</type> + <structfield>conflicting</structfield> <type>bool</type> </para> <para> - 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: + True if this logical slot conflicted with recovery (and so is now + invalidated). When this column is true, check + <structfield>invalidation_reason</structfield> column for the conflict + reason. Always NULL for physical slots. + </para></entry> + </row> + + <row> + <entry role="catalog_table_entry"><para role="column_definition"> + <structfield>invalidation_reason</structfield> <type>text</type> + </para> + <para> + The reason for the slot's invalidation. It is set for both logical and + physical slots. <literal>NULL</literal> if the slot is not invalidated. + Possible values are: <itemizedlist spacing="compact"> <listitem> <para> @@ -2542,14 +2553,14 @@ SELECT * FROM pg_locks pl LEFT JOIN pg_prepared_xacts ppx <listitem> <para> <literal>rows_removed</literal> means that the required rows have - been removed. + been removed. It is set only for logical slots. </para> </listitem> <listitem> <para> <literal>wal_level_insufficient</literal> means that the primary doesn't have a <xref linkend="guc-wal-level"/> sufficient to - perform logical decoding. + perform logical decoding. It is set only for logical slots. </para> </listitem> </itemizedlist> |