diff options
| author | Amit Kapila <akapila@postgresql.org> | 2023-01-18 09:03:12 +0530 |
|---|---|---|
| committer | Amit Kapila <akapila@postgresql.org> | 2023-01-18 09:03:12 +0530 |
| commit | d540a02a724b9643205abce8c5644a0f0908f6e3 (patch) | |
| tree | bb5103b31bfcbfb162bb1544c3e4766d66d13780 /doc/src | |
| parent | 14bdb3f13de16523609d838b725540af5e23ddd3 (diff) | |
Display the leader apply worker's PID for parallel apply workers.
Add leader_pid to pg_stat_subscription. leader_pid is the process ID of
the leader apply worker if this process is a parallel apply worker. If
this field is NULL, it indicates that the process is a leader apply
worker or a synchronization worker. The new column makes it easier to
distinguish parallel apply workers from other kinds of workers and helps
to identify the leader for the parallel workers corresponding to a
particular subscription.
Additionally, update the leader_pid column in pg_stat_activity as well to
display the PID of the leader apply worker for parallel apply workers.
Author: Hou Zhijie
Reviewed-by: Peter Smith, Sawada Masahiko, Amit Kapila, Shveta Mallik
Discussion: https://postgr.es/m/CAA4eK1+wyN6zpaHUkCLorEWNx75MG0xhMwcFhvjqm2KURZEAGw@mail.gmail.com
Diffstat (limited to 'doc/src')
| -rw-r--r-- | doc/src/sgml/logical-replication.sgml | 3 | ||||
| -rw-r--r-- | doc/src/sgml/monitoring.sgml | 36 |
2 files changed, 28 insertions, 11 deletions
diff --git a/doc/src/sgml/logical-replication.sgml b/doc/src/sgml/logical-replication.sgml index 54f48be87f3..f4b4e641beb 100644 --- a/doc/src/sgml/logical-replication.sgml +++ b/doc/src/sgml/logical-replication.sgml @@ -1692,7 +1692,8 @@ CONTEXT: processing remote data for replication origin "pg_16395" during "INSER subscription. A disabled subscription or a crashed subscription will have zero rows in this view. If the initial data synchronization of any table is in progress, there will be additional workers for the tables - being synchronized. + being synchronized. Moreover, if the streaming transaction is applied in + parallel, there may be additional parallel apply workers. </para> </sect1> diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml index 358d2ff90f8..e3a783abd0f 100644 --- a/doc/src/sgml/monitoring.sgml +++ b/doc/src/sgml/monitoring.sgml @@ -743,9 +743,11 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser <structfield>leader_pid</structfield> <type>integer</type> </para> <para> - Process ID of the parallel group leader, if this process is a - parallel query worker. <literal>NULL</literal> if this process is a - parallel group leader or does not participate in parallel query. + Process ID of the parallel group leader if this process is a parallel + query worker, or process ID of the leader apply worker if this process + is a parallel apply worker. <literal>NULL</literal> indicates that this + process is a parallel group leader or leader apply worker, or does not + participate in any parallel operation. </para></entry> </row> @@ -3208,11 +3210,22 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i <row> <entry role="catalog_table_entry"><para role="column_definition"> + <structfield>leader_pid</structfield> <type>integer</type> + </para> + <para> + Process ID of the leader apply worker if this process is a parallel + apply worker; NULL if this process is a leader apply worker or a + synchronization worker + </para></entry> + </row> + + <row> + <entry role="catalog_table_entry"><para role="column_definition"> <structfield>relid</structfield> <type>oid</type> </para> <para> - OID of the relation that the worker is synchronizing; null for the - main apply worker + OID of the relation that the worker is synchronizing; NULL for the + leader apply worker and parallel apply workers </para></entry> </row> @@ -3222,7 +3235,7 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i </para> <para> Last write-ahead log location received, the initial value of - this field being 0 + this field being 0; NULL for parallel apply workers </para></entry> </row> @@ -3231,7 +3244,8 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i <structfield>last_msg_send_time</structfield> <type>timestamp with time zone</type> </para> <para> - Send time of last message received from origin WAL sender + Send time of last message received from origin WAL sender; NULL for + parallel apply workers </para></entry> </row> @@ -3240,7 +3254,8 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i <structfield>last_msg_receipt_time</structfield> <type>timestamp with time zone</type> </para> <para> - Receipt time of last message received from origin WAL sender + Receipt time of last message received from origin WAL sender; NULL for + parallel apply workers </para></entry> </row> @@ -3249,7 +3264,8 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i <structfield>latest_end_lsn</structfield> <type>pg_lsn</type> </para> <para> - Last write-ahead log location reported to origin WAL sender + Last write-ahead log location reported to origin WAL sender; NULL for + parallel apply workers </para></entry> </row> @@ -3259,7 +3275,7 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i </para> <para> Time of last write-ahead log location reported to origin WAL - sender + sender; NULL for parallel apply workers </para></entry> </row> </tbody> |
