forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit4f29946
committed
worker_spi: Expand set of options to start workers
A couple of new options are added to this module to provide more controlon the ways bgworkers are started:- A new GUC called worker_spi.role to control which role to use bydefault when starting a worker.- worker_spi_launch() gains three arguments: a role OID, a database OIDand flags (currently only BGWORKER_BYPASS_ALLOWCONN). By default, therole OID and the database OID are InvalidOid, in which case the workerwould use the related GUCs.Workers loaded by shared_preload_libraries use the default valuesprovided by the GUCs, with flags at 0. The options are given to themain bgworker routine through bgw_extra. A test case is tweaked tostart two dynamic workers with databases and roles defined by the callerof worker_spi_launch().These additions will have the advantage of expanding the tests forbgworkers, for at least two cases:- BGWORKER_BYPASS_ALLOWCONN has no coverage in the core tree.- A new bgworker flag is under discussion, and this eases theintegration of new tests.Reviewed-by: Bertrand DrouvotDiscussion:https://postgr.es/m/bcc36259-7850-4882-97ef-d6b905d2fc51@gmail.com1 parentc789f0f commit4f29946
File tree
3 files changed
+114
-11
lines changed- src/test/modules/worker_spi
- t
3 files changed
+114
-11
lines changedLines changed: 20 additions & 9 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
20 | 20 |
| |
21 | 21 |
| |
22 | 22 |
| |
23 |
| - | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
24 | 26 |
| |
25 | 27 |
| |
26 | 28 |
| |
| |||
44 | 46 |
| |
45 | 47 |
| |
46 | 48 |
| |
47 |
| - | |
48 |
| - | |
| 49 | + | |
49 | 50 |
| |
50 | 51 |
| |
51 | 52 |
| |
| |||
58 | 59 |
| |
59 | 60 |
| |
60 | 61 |
| |
| 62 | + | |
61 | 63 |
| |
62 | 64 |
| |
63 | 65 |
| |
| |||
80 | 82 |
| |
81 | 83 |
| |
82 | 84 |
| |
83 |
| - | |
84 |
| - | |
85 |
| - | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
86 | 96 |
| |
87 | 97 |
| |
88 | 98 |
| |
89 |
| - | |
| 99 | + | |
90 | 100 |
| |
91 |
| - | |
92 |
| - | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
93 | 104 |
| |
94 | 105 |
| |
95 | 106 |
| |
|
Lines changed: 5 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3 | 3 |
| |
4 | 4 |
| |
5 | 5 |
| |
6 |
| - | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
7 | 11 |
| |
8 | 12 |
| |
9 | 13 |
|
Lines changed: 89 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
34 | 34 |
| |
35 | 35 |
| |
36 | 36 |
| |
| 37 | + | |
37 | 38 |
| |
38 | 39 |
| |
39 | 40 |
| |
40 | 41 |
| |
| 42 | + | |
41 | 43 |
| |
42 | 44 |
| |
43 | 45 |
| |
| |||
52 | 54 |
| |
53 | 55 |
| |
54 | 56 |
| |
| 57 | + | |
55 | 58 |
| |
56 | 59 |
| |
57 | 60 |
| |
| |||
138 | 141 |
| |
139 | 142 |
| |
140 | 143 |
| |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
141 | 148 |
| |
142 | 149 |
| |
143 | 150 |
| |
144 | 151 |
| |
145 | 152 |
| |
146 | 153 |
| |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
147 | 162 |
| |
148 | 163 |
| |
149 | 164 |
| |
| |||
152 | 167 |
| |
153 | 168 |
| |
154 | 169 |
| |
155 |
| - | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
156 | 175 |
| |
157 | 176 |
| |
158 | 177 |
| |
| |||
316 | 335 |
| |
317 | 336 |
| |
318 | 337 |
| |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
319 | 347 |
| |
320 | 348 |
| |
321 | 349 |
| |
| |||
346 | 374 |
| |
347 | 375 |
| |
348 | 376 |
| |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
349 | 381 |
| |
350 | 382 |
| |
351 | 383 |
| |
| |||
364 | 396 |
| |
365 | 397 |
| |
366 | 398 |
| |
| 399 | + | |
| 400 | + | |
367 | 401 |
| |
368 | 402 |
| |
369 | 403 |
| |
370 | 404 |
| |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
371 | 411 |
| |
372 | 412 |
| |
373 | 413 |
| |
| |||
382 | 422 |
| |
383 | 423 |
| |
384 | 424 |
| |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
385 | 473 |
| |
386 | 474 |
| |
387 | 475 |
| |
|
0 commit comments
Comments
(0)