forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitd0fe304
committed
Use actual backend IDs in pg_stat_get_backend_subxact().
Unlike the other pg_stat_get_backend* functions,pg_stat_get_backend_subxact() looks up the backend entry by usingits integer argument as a 1-based index in an internal array. Theother functions look for the entry with the matching sessionbackend ID. These numbers often match, but that isn't reliablytrue.This commit resolves this discrepancy by introducingpgstat_get_local_beentry_by_backend_id() and using it inpg_stat_get_backend_subxact(). We cannot usepgstat_get_beentry_by_backend_id() because it returns aPgBackendStatus, which lacks the locally computed additionsavailable in LocalPgBackendStatus that are required bypg_stat_get_backend_subxact().Author: Ian BarwickReviewed-by: Sami Imseih, Michael Paquier, Robert HaasDiscussion:https://postgr.es/m/CAB8KJ%3Dj-ACb3H4L9a_b3ZG3iCYDW5aEu3WsPAzkm2S7JzS1Few%40mail.gmail.comBackpatch-through: 161 parent3d51cb5 commitd0fe304
File tree
3 files changed
+29
-10
lines changed- src
- backend/utils
- activity
- adt
- include/utils
3 files changed
+29
-10
lines changedLines changed: 27 additions & 9 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1088 | 1088 |
| |
1089 | 1089 |
| |
1090 | 1090 |
| |
| 1091 | + | |
| 1092 | + | |
| 1093 | + | |
| 1094 | + | |
| 1095 | + | |
| 1096 | + | |
| 1097 | + | |
| 1098 | + | |
| 1099 | + | |
| 1100 | + | |
| 1101 | + | |
| 1102 | + | |
| 1103 | + | |
| 1104 | + | |
| 1105 | + | |
| 1106 | + | |
| 1107 | + | |
| 1108 | + | |
| 1109 | + | |
| 1110 | + | |
| 1111 | + | |
| 1112 | + | |
| 1113 | + | |
| 1114 | + | |
| 1115 | + | |
1091 | 1116 |
| |
1092 | 1117 |
| |
1093 |
| - | |
1094 | 1118 |
| |
1095 | 1119 |
| |
1096 | 1120 |
| |
| |||
1099 | 1123 |
| |
1100 | 1124 |
| |
1101 | 1125 |
| |
1102 |
| - | |
1103 |
| - | |
1104 |
| - | |
1105 |
| - | |
1106 |
| - | |
1107 |
| - | |
1108 |
| - | |
1109 |
| - | |
| 1126 | + | |
| 1127 | + | |
1110 | 1128 |
| |
1111 | 1129 |
| |
1112 | 1130 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
727 | 727 |
| |
728 | 728 |
| |
729 | 729 |
| |
730 |
| - | |
| 730 | + | |
731 | 731 |
| |
732 | 732 |
| |
733 | 733 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
334 | 334 |
| |
335 | 335 |
| |
336 | 336 |
| |
| 337 | + | |
337 | 338 |
| |
338 | 339 |
| |
339 | 340 |
| |
|
0 commit comments
Comments
(0)