forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit4b7ae4a
committed
Report the current queries of all backends involved in a deadlock
(if they'd be visible to the current user in pg_stat_activity).This might look like it's subject to race conditions, but it's actuallypretty safe because at the time DeadLockReport() is constructing thereport, we haven't yet aborted our transaction and so we can expect thateveryone else involved in the deadlock is still blocked on some lock.(There are corner cases where that might not be true, such as a statementtimeout triggering in another backend before we finish reporting; but atworst we'd report a misleading activity string, so it seems acceptableconsidering the usefulness of reporting the queries.)Original patch by Itagaki Takahiro, heavily modified by me.1 parentdf812e9 commit4b7ae4a
File tree
3 files changed
+103
-15
lines changed- src
- backend
- postmaster
- storage/lmgr
- include
3 files changed
+103
-15
lines changedLines changed: 75 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
13 | 13 |
| |
14 | 14 |
| |
15 | 15 |
| |
16 |
| - | |
| 16 | + | |
17 | 17 |
| |
18 | 18 |
| |
19 | 19 |
| |
| |||
2036 | 2036 |
| |
2037 | 2037 |
| |
2038 | 2038 |
| |
| 2039 | + | |
| 2040 | + | |
| 2041 | + | |
| 2042 | + | |
| 2043 | + | |
| 2044 | + | |
| 2045 | + | |
| 2046 | + | |
| 2047 | + | |
| 2048 | + | |
| 2049 | + | |
| 2050 | + | |
| 2051 | + | |
| 2052 | + | |
| 2053 | + | |
| 2054 | + | |
| 2055 | + | |
| 2056 | + | |
| 2057 | + | |
| 2058 | + | |
| 2059 | + | |
| 2060 | + | |
| 2061 | + | |
| 2062 | + | |
| 2063 | + | |
| 2064 | + | |
| 2065 | + | |
| 2066 | + | |
| 2067 | + | |
| 2068 | + | |
| 2069 | + | |
| 2070 | + | |
| 2071 | + | |
| 2072 | + | |
| 2073 | + | |
| 2074 | + | |
| 2075 | + | |
| 2076 | + | |
| 2077 | + | |
| 2078 | + | |
| 2079 | + | |
| 2080 | + | |
| 2081 | + | |
| 2082 | + | |
| 2083 | + | |
| 2084 | + | |
| 2085 | + | |
| 2086 | + | |
| 2087 | + | |
| 2088 | + | |
| 2089 | + | |
| 2090 | + | |
| 2091 | + | |
| 2092 | + | |
| 2093 | + | |
| 2094 | + | |
| 2095 | + | |
| 2096 | + | |
| 2097 | + | |
| 2098 | + | |
| 2099 | + | |
| 2100 | + | |
| 2101 | + | |
| 2102 | + | |
| 2103 | + | |
| 2104 | + | |
| 2105 | + | |
| 2106 | + | |
| 2107 | + | |
| 2108 | + | |
| 2109 | + | |
| 2110 | + | |
| 2111 | + | |
| 2112 | + | |
2039 | 2113 |
| |
2040 | 2114 |
| |
2041 | 2115 |
| |
|
Lines changed: 26 additions & 13 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
12 | 12 |
| |
13 | 13 |
| |
14 | 14 |
| |
15 |
| - | |
| 15 | + | |
16 | 16 |
| |
17 | 17 |
| |
18 | 18 |
| |
| |||
26 | 26 |
| |
27 | 27 |
| |
28 | 28 |
| |
| 29 | + | |
29 | 30 |
| |
30 | 31 |
| |
31 | 32 |
| |
| |||
878 | 879 |
| |
879 | 880 |
| |
880 | 881 |
| |
881 |
| - | |
882 |
| - | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
883 | 885 |
| |
884 | 886 |
| |
885 |
| - | |
886 |
| - | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
887 | 890 |
| |
888 | 891 |
| |
889 | 892 |
| |
| |||
896 | 899 |
| |
897 | 900 |
| |
898 | 901 |
| |
899 |
| - | |
900 |
| - | |
| 902 | + | |
| 903 | + | |
901 | 904 |
| |
902 |
| - | |
903 |
| - | |
| 905 | + | |
904 | 906 |
| |
905 |
| - | |
| 907 | + | |
| 908 | + | |
906 | 909 |
| |
907 |
| - | |
| 910 | + | |
908 | 911 |
| |
909 | 912 |
| |
910 | 913 |
| |
911 | 914 |
| |
912 |
| - | |
| 915 | + | |
913 | 916 |
| |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
914 | 925 |
| |
| 926 | + | |
915 | 927 |
| |
916 | 928 |
| |
917 | 929 |
| |
918 |
| - | |
| 930 | + | |
| 931 | + | |
919 | 932 |
| |
920 | 933 |
| |
921 | 934 |
| |
|
Lines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
5 | 5 |
| |
6 | 6 |
| |
7 | 7 |
| |
8 |
| - | |
| 8 | + | |
9 | 9 |
| |
10 | 10 |
| |
11 | 11 |
| |
| |||
507 | 507 |
| |
508 | 508 |
| |
509 | 509 |
| |
| 510 | + | |
510 | 511 |
| |
511 | 512 |
| |
512 | 513 |
| |
|
0 commit comments
Comments
(0)