forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitea8e1bb
committed
Improve error detection capability in proclists.
Previously, although the initial state of a proclist_node is expectedto be next == prev == 0, proclist_delete_offset would reset nodes tonext == prev == INVALID_PGPROCNO when removing them from a list.This is the same state that a node in a singleton list has, so thatit's impossible to distinguish not-in-a-list from in-a-list. Changeproclist_delete_offset to reset removed nodes to next == prev == 0,making it possible to distinguish those cases, and then add Assertsto the list add and delete functions that the supplied node isn'tor is in a list at entry. Also tighten assertions about the nodebeing in the particular list (not some other one) where it is possibleto check that in O(1) time.In ConditionVariablePrepareToSleep, since we don't expect the process'scvWaitLink to already be in a list, remove the more-or-less-uselessproclist_contains check; we'd rather have proclist_push_tail's newassertion fire if that happens.Improve various comments related to proclists, too.Patch by me, reviewed by Thomas Munro. This isn't back-patchable, sincethere could theoretically be inlined copies of proclist_delete_offset inthird-party modules. But it's only improving debuggability anyway.Discussion:https://postgr.es/m/CAEepm=0NWKehYw7NDoUSf8juuKOPRnCyY3vuaSvhrEWsOTAa3w@mail.gmail.com1 parenteeb3c2d commitea8e1bb
File tree
3 files changed
+43
-27
lines changed- src
- backend/storage/lmgr
- include/storage
3 files changed
+43
-27
lines changedLines changed: 1 addition & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
86 | 86 |
| |
87 | 87 |
| |
88 | 88 |
| |
89 |
| - | |
90 |
| - | |
| 89 | + | |
91 | 90 |
| |
92 | 91 |
| |
93 | 92 |
| |
|
Lines changed: 33 additions & 22 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
42 | 42 |
| |
43 | 43 |
| |
44 | 44 |
| |
45 |
| - | |
| 45 | + | |
46 | 46 |
| |
47 | 47 |
| |
48 | 48 |
| |
| |||
53 | 53 |
| |
54 | 54 |
| |
55 | 55 |
| |
56 |
| - | |
| 56 | + | |
57 | 57 |
| |
58 | 58 |
| |
59 | 59 |
| |
60 | 60 |
| |
61 | 61 |
| |
62 | 62 |
| |
| 63 | + | |
| 64 | + | |
63 | 65 |
| |
64 | 66 |
| |
65 | 67 |
| |
| |||
79 | 81 |
| |
80 | 82 |
| |
81 | 83 |
| |
82 |
| - | |
| 84 | + | |
83 | 85 |
| |
84 | 86 |
| |
85 | 87 |
| |
86 | 88 |
| |
87 | 89 |
| |
88 | 90 |
| |
| 91 | + | |
| 92 | + | |
89 | 93 |
| |
90 | 94 |
| |
91 | 95 |
| |
| |||
105 | 109 |
| |
106 | 110 |
| |
107 | 111 |
| |
108 |
| - | |
| 112 | + | |
109 | 113 |
| |
110 | 114 |
| |
111 | 115 |
| |
112 | 116 |
| |
113 | 117 |
| |
114 | 118 |
| |
| 119 | + | |
| 120 | + | |
115 | 121 |
| |
| 122 | + | |
| 123 | + | |
116 | 124 |
| |
| 125 | + | |
117 | 126 |
| |
118 | 127 |
| |
119 | 128 |
| |
120 | 129 |
| |
| 130 | + | |
| 131 | + | |
121 | 132 |
| |
| 133 | + | |
122 | 134 |
| |
123 | 135 |
| |
124 | 136 |
| |
125 |
| - | |
| 137 | + | |
126 | 138 |
| |
127 | 139 |
| |
128 | 140 |
| |
129 |
| - | |
130 |
| - | |
131 |
| - | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
132 | 144 |
| |
133 | 145 |
| |
134 | 146 |
| |
135 | 147 |
| |
136 | 148 |
| |
137 | 149 |
| |
138 | 150 |
| |
139 |
| - | |
140 |
| - | |
141 |
| - | |
142 |
| - | |
143 |
| - | |
| 151 | + | |
144 | 152 |
| |
145 | 153 |
| |
146 | 154 |
| |
147 |
| - | |
148 |
| - | |
149 |
| - | |
150 |
| - | |
151 | 155 |
| |
152 |
| - | |
153 |
| - | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
154 | 162 |
| |
155 |
| - | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
156 | 167 |
| |
157 | 168 |
| |
158 | 169 |
| |
159 |
| - | |
| 170 | + | |
160 | 171 |
| |
161 | 172 |
| |
162 | 173 |
| |
| |||
205 | 216 |
| |
206 | 217 |
| |
207 | 218 |
| |
208 |
| - | |
| 219 | + |
Lines changed: 9 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
16 | 16 |
| |
17 | 17 |
| |
18 | 18 |
| |
19 |
| - | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
20 | 25 |
| |
21 | 26 |
| |
22 | 27 |
| |
| |||
25 | 30 |
| |
26 | 31 |
| |
27 | 32 |
| |
28 |
| - | |
| 33 | + | |
| 34 | + | |
29 | 35 |
| |
30 | 36 |
| |
31 | 37 |
| |
| |||
42 | 48 |
| |
43 | 49 |
| |
44 | 50 |
| |
45 |
| - | |
| 51 | + |
0 commit comments
Comments
(0)