Display the leader apply worker's PID for parallel apply workers.
Amit Kapila <akapila@postgresql.org>
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
Files
| Path | Change | +/− |
|---|---|---|
| doc/src/sgml/logical-replication.sgml | modified | +2 −1 |
| doc/src/sgml/monitoring.sgml | modified | +26 −10 |
| src/backend/catalog/system_views.sql | modified | +1 −0 |
| src/backend/replication/logical/applyparallelworker.c | modified | +3 −3 |
| src/backend/replication/logical/launcher.c | modified | +47 −17 |
| src/backend/utils/adt/pgstatfuncs.c | modified | +16 −5 |
| src/include/catalog/catversion.h | modified | +1 −1 |
| src/include/catalog/pg_proc.dat | modified | +3 −3 |
| src/include/replication/logicallauncher.h | modified | +2 −0 |
| src/include/replication/worker_internal.h | modified | +2 −2 |
| src/test/regress/expected/rules.out | modified | +2 −1 |
Documentation touched
Discussion
- Perform streaming logical transactions by background workers and parallel apply 573 messages · 2022-04-06 → 2023-05-09