forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit64b2e7a
committed
Pass extra data to bgworkers, and use this to fix parallel contexts.
Up until now, the total amount of data that could be passed to abackground worker at startup was one datum, which can be a small as4 bytes on some systems. That's enough to pass a dsm_handle or anarray index, but not much else. Add a bgw_extra flag to theBackgroundWorker struct, allowing up to 128 bytes to be passed toa new worker on any platform.Use this to fix a problem I recently discovered with the parallelcontext machinery added in 9.5: the master assigns each worker anarray index, and each worker subsequently assigns itself an arrayindex, and there's nothing to guarantee that the two sets of indexesmatch, leading to chaos.Normally, I would not back-patch the change to add bgw_extra, since itis basically a feature addition. However, since 9.5 is still in betaand there seems to be no other sensible way to repair the brokenparallel context machinery, back-patch to 9.5. Existing backgroundworker code can ignore the bgw_extra field without a problem, butmight need to be recompiled since the structure size has changed.Report and patch by me. Review by Amit Kapila.1 parent59464bd commit64b2e7a
File tree
4 files changed
+18
-17
lines changed- doc/src/sgml
- src
- backend
- access/transam
- postmaster
- include/postmaster
4 files changed
+18
-17
lines changedLines changed: 8 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
58 | 58 |
| |
59 | 59 |
| |
60 | 60 |
| |
| 61 | + | |
61 | 62 |
| |
62 | 63 |
| |
63 | 64 |
| |
| |||
182 | 183 |
| |
183 | 184 |
| |
184 | 185 |
| |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
185 | 193 |
| |
186 | 194 |
| |
187 | 195 |
| |
|
Lines changed: 7 additions & 17 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
77 | 77 |
| |
78 | 78 |
| |
79 | 79 |
| |
80 |
| - | |
81 |
| - | |
82 |
| - | |
83 |
| - | |
84 | 80 |
| |
85 | 81 |
| |
86 | 82 |
| |
| |||
295 | 291 |
| |
296 | 292 |
| |
297 | 293 |
| |
298 |
| - | |
299 |
| - | |
300 | 294 |
| |
301 | 295 |
| |
302 | 296 |
| |
| |||
403 | 397 |
| |
404 | 398 |
| |
405 | 399 |
| |
406 |
| - | |
407 | 400 |
| |
408 | 401 |
| |
409 | 402 |
| |
| |||
455 | 448 |
| |
456 | 449 |
| |
457 | 450 |
| |
| 451 | + | |
458 | 452 |
| |
459 | 453 |
| |
460 | 454 |
| |
| |||
466 | 460 |
| |
467 | 461 |
| |
468 | 462 |
| |
| 463 | + | |
469 | 464 |
| |
470 | 465 |
| |
471 | 466 |
| |
| |||
891 | 886 |
| |
892 | 887 |
| |
893 | 888 |
| |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
894 | 893 |
| |
895 | 894 |
| |
896 | 895 |
| |
| |||
915 | 914 |
| |
916 | 915 |
| |
917 | 916 |
| |
918 |
| - | |
| 917 | + | |
919 | 918 |
| |
920 | 919 |
| |
921 |
| - | |
922 |
| - | |
923 |
| - | |
924 |
| - | |
925 |
| - | |
926 |
| - | |
927 |
| - | |
928 |
| - | |
929 |
| - | |
930 | 920 |
| |
931 | 921 |
| |
932 | 922 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
314 | 314 |
| |
315 | 315 |
| |
316 | 316 |
| |
| 317 | + | |
317 | 318 |
| |
318 | 319 |
| |
319 | 320 |
| |
|
Lines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
74 | 74 |
| |
75 | 75 |
| |
76 | 76 |
| |
| 77 | + | |
77 | 78 |
| |
78 | 79 |
| |
79 | 80 |
| |
| |||
85 | 86 |
| |
86 | 87 |
| |
87 | 88 |
| |
| 89 | + | |
88 | 90 |
| |
89 | 91 |
| |
90 | 92 |
| |
|
0 commit comments
Comments
(0)