forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit21b0055
committed
Tweak behavior of pg_stat_activity.leader_pid
The initial implementation of leader_pid in pg_stat_activity added byb025f32 took the approach to strictly print what a PGPROC entryincludes. In short, if a backend has been involved in parallel query atleast once, leader_pid would remain set as long as the backend is alive.For a parallel group leader, this means that the field would always beset after it participated at least once in parallel query, and aftermore discussions this could be confusing if using for example aconnection pooler.This commit changes the data printed so as leader_pid becomes alwaysNULL for a parallel group leader, showing up a non-NULL value only forthe parallel workers, and actually as long as a parallel query isrunning as workers are shut down once the query has completed.This does not change the definition of any catalog, so no catalog bumpis needed. Per discussion with Justin Pryzby, Álvaro Herrera, JulienRouhaud and me.Discussion:https://postgr.es/m/20200721035145.GB17300@paquier.xyzBackpatch-through: 131 parentb15367a commit21b0055
File tree
2 files changed
+10
-7
lines changed- doc/src/sgml
- src/backend/utils/adt
2 files changed
+10
-7
lines changedLines changed: 3 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
687 | 687 |
| |
688 | 688 |
| |
689 | 689 |
| |
690 |
| - | |
691 |
| - | |
692 |
| - | |
693 |
| - | |
694 |
| - | |
695 |
| - | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
696 | 693 |
| |
697 | 694 |
| |
698 | 695 |
| |
|
Lines changed: 7 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
735 | 735 |
| |
736 | 736 |
| |
737 | 737 |
| |
738 |
| - | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
739 | 745 |
| |
740 | 746 |
| |
741 | 747 |
| |
|
0 commit comments
Comments
(0)