- Notifications
You must be signed in to change notification settings - Fork28
Commit57e85fa
committed
Fix contrib/auto_explain to not cause problems in parallel workers.
A parallel worker process should not be making any decisions of itsown about whether to auto-explain. If the parent session processpassed down flags asking for instrumentation data, do that, otherwisenot. Trying to enable instrumentation anyway leads to bugs like the"could not find key N in shm TOC" failure reported in bug #15821from Christian Hofstaedtler.We can implement this cheaply by piggybacking on the existing logicfor not doing anything when we've chosen not to sample a statement.While at it, clean up some tin-eared coding related to the samplingfeature, including an off-by-one error that meant that asking for 1.0sampling rate didn't actually result in sampling every statement.Although the specific case reported here only manifested in >= v11,I believe that related misbehaviors can be demonstrated in any versionthat has parallel query; and the off-by-one error is certainly thereback to 9.6 where that feature was added. So back-patch to 9.6.Discussion:https://postgr.es/m/15821-5eb422e980594075@postgresql.org1 parent601084e commit57e85fa
1 file changed
+28
-15
lines changedLines changed: 28 additions & 15 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
14 | 14 |
| |
15 | 15 |
| |
16 | 16 |
| |
| 17 | + | |
17 | 18 |
| |
18 | 19 |
| |
19 | 20 |
| |
| |||
43 | 44 |
| |
44 | 45 |
| |
45 | 46 |
| |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
46 | 55 |
| |
47 | 56 |
| |
48 | 57 |
| |
49 | 58 |
| |
50 | 59 |
| |
51 | 60 |
| |
52 |
| - | |
53 |
| - | |
54 |
| - | |
55 |
| - | |
56 |
| - | |
57 |
| - | |
58 |
| - | |
59 | 61 |
| |
60 | 62 |
| |
61 | 63 |
| |
| |||
210 | 212 |
| |
211 | 213 |
| |
212 | 214 |
| |
213 |
| - | |
214 |
| - | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
215 | 223 |
| |
216 |
| - | |
217 |
| - | |
218 |
| - | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
219 | 232 |
| |
220 |
| - | |
| 233 | + | |
221 | 234 |
| |
222 | 235 |
| |
223 | 236 |
| |
| |||
236 | 249 |
| |
237 | 250 |
| |
238 | 251 |
| |
239 |
| - | |
| 252 | + | |
240 | 253 |
| |
241 | 254 |
| |
242 | 255 |
| |
| |||
307 | 320 |
| |
308 | 321 |
| |
309 | 322 |
| |
310 |
| - | |
| 323 | + | |
311 | 324 |
| |
312 | 325 |
| |
313 | 326 |
| |
|
0 commit comments
Comments
(0)