forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit33181b4
committed
Introduce private data area for injection points
This commit extends the backend-side infrastructure of injection pointsso as it becomes possible to register some input data when attaching apoint. This private data can be registered with the function name andthe library name of the callback when attaching a point, then it isgiven as input argument to the callback. This gives the possibility formodules to pass down custom data at runtime when attaching a pointwithout managing that internally, in a manner consistent with thecallback entry retrieved from the hash shmem table storing the injectionpoint data.InjectionPointAttach() gains two arguments, to be able to define theprivate data contents and its size.A follow-up commit will rely on this infrastructure to close a racecondition with the injection point detach in the moduleinjection_points.While on it, this changes InjectionPointDetach() to return a boolean,returning false if a point cannot be detached. This has been mentionedby Noah as useful when it comes to implement more complex tests withconcurrent point detach, solid with the automatic detach done for localpoints in the test module.Documentation is adjusted in consequence.Per discussion with Noah Misch.Reviewed-by: Noah MischDiscussion:https://postgr.es/m/20240509031553.47@rfd.leadboat.com1 parent407e0b0 commit33181b4
File tree
5 files changed
+74
-28
lines changed- doc/src/sgml
- src
- backend/utils/misc
- include/utils
- test/modules/injection_points
- expected
5 files changed
+74
-28
lines changedLines changed: 10 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3624 | 3624 |
| |
3625 | 3625 |
| |
3626 | 3626 |
| |
3627 |
| - | |
| 3627 | + | |
| 3628 | + | |
| 3629 | + | |
3628 | 3630 |
| |
3629 | 3631 |
| |
3630 | 3632 |
| |
3631 | 3633 |
| |
3632 |
| - | |
| 3634 | + | |
| 3635 | + | |
| 3636 | + | |
3633 | 3637 |
| |
3634 | 3638 |
| |
3635 | 3639 |
| |
3636 | 3640 |
| |
3637 | 3641 |
| |
3638 | 3642 |
| |
3639 | 3643 |
| |
3640 |
| - | |
| 3644 | + | |
3641 | 3645 |
| |
3642 | 3646 |
| |
3643 | 3647 |
| |
| |||
3650 | 3654 |
| |
3651 | 3655 |
| |
3652 | 3656 |
| |
3653 |
| - | |
| 3657 | + | |
3654 | 3658 |
| |
| 3659 | + | |
| 3660 | + | |
3655 | 3661 |
| |
3656 | 3662 |
| |
3657 | 3663 |
| |
|
Lines changed: 44 additions & 11 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 | 49 |
| |
49 | 50 |
| |
50 | 51 |
| |
51 | 52 |
| |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
52 | 59 |
| |
53 | 60 |
| |
54 | 61 |
| |
| |||
61 | 68 |
| |
62 | 69 |
| |
63 | 70 |
| |
| 71 | + | |
64 | 72 |
| |
65 | 73 |
| |
66 | 74 |
| |
| |||
73 | 81 |
| |
74 | 82 |
| |
75 | 83 |
| |
76 |
| - | |
| 84 | + | |
| 85 | + | |
77 | 86 |
| |
78 | 87 |
| |
79 | 88 |
| |
| |||
99 | 108 |
| |
100 | 109 |
| |
101 | 110 |
| |
| 111 | + | |
| 112 | + | |
102 | 113 |
| |
103 | 114 |
| |
104 | 115 |
| |
| |||
124 | 135 |
| |
125 | 136 |
| |
126 | 137 |
| |
127 |
| - | |
| 138 | + | |
128 | 139 |
| |
129 | 140 |
| |
130 | 141 |
| |
131 | 142 |
| |
| 143 | + | |
| 144 | + | |
| 145 | + | |
132 | 146 |
| |
133 | 147 |
| |
134 | 148 |
| |
| |||
137 | 151 |
| |
138 | 152 |
| |
139 | 153 |
| |
| 154 | + | |
| 155 | + | |
| 156 | + | |
140 | 157 |
| |
| 158 | + | |
141 | 159 |
| |
142 | 160 |
| |
143 | 161 |
| |
| |||
186 | 204 |
| |
187 | 205 |
| |
188 | 206 |
| |
189 |
| - | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
190 | 210 |
| |
191 | 211 |
| |
192 | 212 |
| |
| |||
201 | 221 |
| |
202 | 222 |
| |
203 | 223 |
| |
| 224 | + | |
| 225 | + | |
| 226 | + | |
204 | 227 |
| |
205 | 228 |
| |
206 | 229 |
| |
| |||
223 | 246 |
| |
224 | 247 |
| |
225 | 248 |
| |
| 249 | + | |
| 250 | + | |
226 | 251 |
| |
227 | 252 |
| |
228 | 253 |
| |
| |||
233 | 258 |
| |
234 | 259 |
| |
235 | 260 |
| |
| 261 | + | |
| 262 | + | |
236 | 263 |
| |
237 |
| - | |
| 264 | + | |
238 | 265 |
| |
239 | 266 |
| |
240 | 267 |
| |
| |||
245 | 272 |
| |
246 | 273 |
| |
247 | 274 |
| |
248 |
| - | |
| 275 | + | |
249 | 276 |
| |
| 277 | + | |
250 | 278 |
| |
251 | 279 |
| |
| 280 | + | |
252 | 281 |
| |
253 | 282 |
| |
254 | 283 |
| |
| |||
265 | 294 |
| |
266 | 295 |
| |
267 | 296 |
| |
| 297 | + | |
268 | 298 |
| |
269 | 299 |
| |
270 | 300 |
| |
| |||
286 | 316 |
| |
287 | 317 |
| |
288 | 318 |
| |
289 |
| - | |
290 |
| - | |
| 319 | + | |
291 | 320 |
| |
292 | 321 |
| |
| 322 | + | |
293 | 323 |
| |
294 | 324 |
| |
295 | 325 |
| |
| |||
299 | 329 |
| |
300 | 330 |
| |
301 | 331 |
| |
302 |
| - | |
| 332 | + | |
303 | 333 |
| |
304 | 334 |
| |
305 |
| - | |
| 335 | + | |
306 | 336 |
| |
307 | 337 |
| |
308 | 338 |
| |
309 | 339 |
| |
310 |
| - | |
| 340 | + | |
| 341 | + | |
311 | 342 |
| |
312 | 343 |
| |
313 |
| - | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
314 | 347 |
| |
315 | 348 |
| |
316 | 349 |
| |
|
Lines changed: 6 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
23 | 23 |
| |
24 | 24 |
| |
25 | 25 |
| |
26 |
| - | |
| 26 | + | |
| 27 | + | |
27 | 28 |
| |
28 | 29 |
| |
29 | 30 |
| |
30 | 31 |
| |
31 | 32 |
| |
32 | 33 |
| |
33 |
| - | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
34 | 37 |
| |
35 |
| - | |
| 38 | + | |
36 | 39 |
| |
37 | 40 |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
114 | 114 |
| |
115 | 115 |
| |
116 | 116 |
| |
117 |
| - | |
| 117 | + | |
118 | 118 |
| |
119 | 119 |
| |
120 | 120 |
| |
|
Lines changed: 13 additions & 9 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
73 | 73 |
| |
74 | 74 |
| |
75 | 75 |
| |
76 |
| - | |
77 |
| - | |
78 |
| - | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
79 | 82 |
| |
80 | 83 |
| |
81 | 84 |
| |
| |||
189 | 192 |
| |
190 | 193 |
| |
191 | 194 |
| |
192 |
| - | |
| 195 | + | |
193 | 196 |
| |
194 | 197 |
| |
195 | 198 |
| |
| |||
211 | 214 |
| |
212 | 215 |
| |
213 | 216 |
| |
214 |
| - | |
| 217 | + | |
215 | 218 |
| |
216 | 219 |
| |
217 | 220 |
| |
| |||
220 | 223 |
| |
221 | 224 |
| |
222 | 225 |
| |
223 |
| - | |
| 226 | + | |
224 | 227 |
| |
225 | 228 |
| |
226 | 229 |
| |
| |||
230 | 233 |
| |
231 | 234 |
| |
232 | 235 |
| |
233 |
| - | |
| 236 | + | |
234 | 237 |
| |
235 | 238 |
| |
236 | 239 |
| |
| |||
311 | 314 |
| |
312 | 315 |
| |
313 | 316 |
| |
314 |
| - | |
| 317 | + | |
315 | 318 |
| |
316 | 319 |
| |
317 | 320 |
| |
| |||
430 | 433 |
| |
431 | 434 |
| |
432 | 435 |
| |
433 |
| - | |
| 436 | + | |
| 437 | + | |
434 | 438 |
| |
435 | 439 |
| |
436 | 440 |
| |
|
0 commit comments
Comments
(0)