forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit4f2400c
committed
Add a new shmem_request_hook hook.
Currently, preloaded libraries are expected to request additionalshared memory and LWLocks in _PG_init(). However, it is not unusalfor such requests to depend on MaxBackends, which won't beinitialized at that time. Such requests could also depend on GUCsthat other modules might change. This introduces a new hook wheremodules can safely use MaxBackends and GUCs to request additionalshared memory and LWLocks.Furthermore, this change restricts requests for shared memory andLWLocks to this hook. Previously, libraries could make requestsuntil the size of the main shared memory segment was calculated.Unlike before, we no longer silently ignore requests received atinvalid times. Instead, we FATAL if someone tries to requestadditional shared memory or LWLocks outside of the hook.Nathan Bossart and Julien RouhaudDiscussion:https://postgr.es/m/20220412210112.GA2065815%40nathanxps13Discussion:https://postgr.es/m/Yn2jE/lmDhKtkUdr@paquier.xyz1 parent8c8d307 commit4f2400c
File tree
9 files changed
+81
-38
lines changed- contrib
- pg_prewarm
- pg_stat_statements
- doc/src/sgml
- src
- backend
- postmaster
- storage
- ipc
- lmgr
- utils/init
- include
- tools/pgindent
9 files changed
+81
-38
lines changedLines changed: 16 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
96 | 96 |
| |
97 | 97 |
| |
98 | 98 |
| |
| 99 | + | |
| 100 | + | |
99 | 101 |
| |
100 | 102 |
| |
101 | 103 |
| |
| |||
139 | 141 |
| |
140 | 142 |
| |
141 | 143 |
| |
142 |
| - | |
| 144 | + | |
| 145 | + | |
143 | 146 |
| |
144 | 147 |
| |
145 | 148 |
| |
146 | 149 |
| |
147 | 150 |
| |
148 | 151 |
| |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
149 | 164 |
| |
150 | 165 |
| |
151 | 166 |
| |
|
Lines changed: 18 additions & 8 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
252 | 252 |
| |
253 | 253 |
| |
254 | 254 |
| |
| 255 | + | |
255 | 256 |
| |
256 | 257 |
| |
257 | 258 |
| |
| |||
316 | 317 |
| |
317 | 318 |
| |
318 | 319 |
| |
| 320 | + | |
319 | 321 |
| |
320 | 322 |
| |
321 | 323 |
| |
| |||
451 | 453 |
| |
452 | 454 |
| |
453 | 455 |
| |
454 |
| - | |
455 |
| - | |
456 |
| - | |
457 |
| - | |
458 |
| - | |
459 |
| - | |
460 |
| - | |
461 |
| - | |
462 | 456 |
| |
463 | 457 |
| |
464 | 458 |
| |
| 459 | + | |
| 460 | + | |
465 | 461 |
| |
466 | 462 |
| |
467 | 463 |
| |
| |||
480 | 476 |
| |
481 | 477 |
| |
482 | 478 |
| |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
483 | 493 |
| |
484 | 494 |
| |
485 | 495 |
| |
|
Lines changed: 10 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3402 | 3402 |
| |
3403 | 3403 |
| |
3404 | 3404 |
| |
| 3405 | + | |
| 3406 | + | |
| 3407 | + | |
3405 | 3408 |
| |
3406 | 3409 |
| |
3407 | 3410 |
| |
3408 | 3411 |
| |
3409 |
| - | |
| 3412 | + | |
3410 | 3413 |
| |
3411 | 3414 |
| |
3412 | 3415 |
| |
3413 | 3416 |
| |
3414 | 3417 |
| |
3415 | 3418 |
| |
3416 |
| - | |
| 3419 | + | |
3417 | 3420 |
| |
3418 | 3421 |
| |
3419 | 3422 |
| |
3420 | 3423 |
| |
| 3424 | + | |
| 3425 | + | |
| 3426 | + | |
| 3427 | + | |
| 3428 | + | |
3421 | 3429 |
| |
3422 | 3430 |
| |
3423 | 3431 |
| |
|
Lines changed: 5 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1042 | 1042 |
| |
1043 | 1043 |
| |
1044 | 1044 |
| |
| 1045 | + | |
| 1046 | + | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
1045 | 1050 |
| |
1046 | 1051 |
| |
1047 | 1052 |
| |
|
Lines changed: 6 additions & 14 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
55 | 55 |
| |
56 | 56 |
| |
57 | 57 |
| |
58 |
| - | |
59 |
| - | |
60 | 58 |
| |
61 | 59 |
| |
62 | 60 |
| |
63 | 61 |
| |
64 | 62 |
| |
65 | 63 |
| |
66 |
| - | |
67 |
| - | |
68 |
| - | |
69 |
| - | |
70 |
| - | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
71 | 67 |
| |
72 | 68 |
| |
73 | 69 |
| |
74 | 70 |
| |
75 |
| - | |
76 |
| - | |
| 71 | + | |
| 72 | + | |
77 | 73 |
| |
78 | 74 |
| |
79 | 75 |
| |
| |||
83 | 79 |
| |
84 | 80 |
| |
85 | 81 |
| |
86 |
| - | |
87 |
| - | |
88 |
| - | |
89 | 82 |
| |
90 | 83 |
| |
91 | 84 |
| |
| |||
152 | 145 |
| |
153 | 146 |
| |
154 | 147 |
| |
155 |
| - | |
156 |
| - | |
| 148 | + | |
157 | 149 |
| |
158 | 150 |
| |
159 | 151 |
| |
|
Lines changed: 5 additions & 13 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
243 | 243 |
| |
244 | 244 |
| |
245 | 245 |
| |
246 |
| - | |
247 |
| - | |
248 | 246 |
| |
249 | 247 |
| |
250 | 248 |
| |
| |||
458 | 456 |
| |
459 | 457 |
| |
460 | 458 |
| |
461 |
| - | |
462 |
| - | |
463 |
| - | |
464 | 459 |
| |
465 | 460 |
| |
466 | 461 |
| |
| |||
691 | 686 |
| |
692 | 687 |
| |
693 | 688 |
| |
694 |
| - | |
695 |
| - | |
696 |
| - | |
697 |
| - | |
698 |
| - | |
699 |
| - | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
700 | 692 |
| |
701 | 693 |
| |
702 | 694 |
| |
| |||
706 | 698 |
| |
707 | 699 |
| |
708 | 700 |
| |
709 |
| - | |
710 |
| - | |
| 701 | + | |
| 702 | + | |
711 | 703 |
| |
712 | 704 |
| |
713 | 705 |
| |
|
Lines changed: 15 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1618 | 1618 |
| |
1619 | 1619 |
| |
1620 | 1620 |
| |
| 1621 | + | |
| 1622 | + | |
| 1623 | + | |
1621 | 1624 |
| |
1622 | 1625 |
| |
1623 | 1626 |
| |
| |||
1701 | 1704 |
| |
1702 | 1705 |
| |
1703 | 1706 |
| |
| 1707 | + | |
| 1708 | + | |
| 1709 | + | |
| 1710 | + | |
| 1711 | + | |
| 1712 | + | |
| 1713 | + | |
| 1714 | + | |
| 1715 | + | |
| 1716 | + | |
| 1717 | + | |
| 1718 | + | |
1704 | 1719 |
| |
1705 | 1720 |
| |
1706 | 1721 |
| |
|
Lines changed: 5 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
465 | 465 |
| |
466 | 466 |
| |
467 | 467 |
| |
| 468 | + | |
468 | 469 |
| |
469 | 470 |
| |
470 | 471 |
| |
| |||
478 | 479 |
| |
479 | 480 |
| |
480 | 481 |
| |
| 482 | + | |
481 | 483 |
| |
482 | 484 |
| |
483 | 485 |
| |
| 486 | + | |
| 487 | + | |
| 488 | + | |
484 | 489 |
| |
485 | 490 |
| |
486 | 491 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3651 | 3651 |
| |
3652 | 3652 |
| |
3653 | 3653 |
| |
| 3654 | + | |
3654 | 3655 |
| |
3655 | 3656 |
| |
3656 | 3657 |
| |
|
0 commit comments
Comments
(0)