- Notifications
You must be signed in to change notification settings - Fork28
Commit496ee64
committed
Prefer standby promotion over recovery pause.
Previously if a promotion was triggered while recovery was paused,the paused state continued. Also recovery could be paused by executingpg_wal_replay_pause() even while a promotion was ongoing. That is,recovery pause had higher priority over a standby promotion.But this behavior was not desirable because most users basically wantedthe recovery to complete as soon as possible and the server to becomethe master when they requested a promotion.This commit changes recovery so that it prefers a promotion overrecovery pause. That is, if a promotion is triggered while recoveryis paused, the paused state ends and a promotion continues. Alsothis commit makes recovery pause functions like pg_wal_replay_pause()throw an error if they are executed while a promotion is ongoing.Internally, this commit adds new internal function PromoteIsTriggered()that returns true if a promotion is triggered. Since the name ofthis function and the existing function IsPromoteTriggered() areconfusingly similar, the commit changes the name of IsPromoteTriggered()to IsPromoteSignaled, as more appropriate name.Author: Fujii MasaoReviewed-by: Atsushi Torikoshi, Sergei KornilovDiscussion:https://postgr.es/m/00c194b2-dbbb-2e8a-5b39-13f14048ef0a@oss.nttdata.com1 parente09ad07 commit496ee64
File tree
7 files changed
+93
-15
lines changed- doc/src/sgml
- src
- backend
- access/transam
- postmaster
- include
- access
- postmaster
7 files changed
+93
-15
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3590 | 3590 | | |
3591 | 3591 | | |
3592 | 3592 | | |
| 3593 | + | |
| 3594 | + | |
| 3595 | + | |
3593 | 3596 | | |
3594 | 3597 | | |
3595 | 3598 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20177 | 20177 | | |
20178 | 20178 | | |
20179 | 20179 | | |
| 20180 | + | |
| 20181 | + | |
| 20182 | + | |
| 20183 | + | |
| 20184 | + | |
| 20185 | + | |
| 20186 | + | |
20180 | 20187 | | |
20181 | 20188 | | |
20182 | 20189 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
229 | 229 | | |
230 | 230 | | |
231 | 231 | | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
232 | 238 | | |
233 | 239 | | |
234 | 240 | | |
| |||
654 | 660 | | |
655 | 661 | | |
656 | 662 | | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
657 | 669 | | |
658 | 670 | | |
659 | 671 | | |
| |||
912 | 924 | | |
913 | 925 | | |
914 | 926 | | |
| 927 | + | |
915 | 928 | | |
916 | 929 | | |
917 | 930 | | |
| |||
5112 | 5125 | | |
5113 | 5126 | | |
5114 | 5127 | | |
| 5128 | + | |
5115 | 5129 | | |
5116 | 5130 | | |
5117 | 5131 | | |
| |||
5940 | 5954 | | |
5941 | 5955 | | |
5942 | 5956 | | |
| 5957 | + | |
| 5958 | + | |
| 5959 | + | |
| 5960 | + | |
5943 | 5961 | | |
5944 | 5962 | | |
5945 | 5963 | | |
5946 | 5964 | | |
5947 | 5965 | | |
5948 | 5966 | | |
| 5967 | + | |
| 5968 | + | |
| 5969 | + | |
5949 | 5970 | | |
5950 | 5971 | | |
5951 | 5972 | | |
5952 | | - | |
5953 | 5973 | | |
5954 | 5974 | | |
5955 | 5975 | | |
| |||
12277 | 12297 | | |
12278 | 12298 | | |
12279 | 12299 | | |
| 12300 | + | |
| 12301 | + | |
| 12302 | + | |
| 12303 | + | |
| 12304 | + | |
| 12305 | + | |
| 12306 | + | |
| 12307 | + | |
| 12308 | + | |
| 12309 | + | |
| 12310 | + | |
| 12311 | + | |
| 12312 | + | |
| 12313 | + | |
| 12314 | + | |
| 12315 | + | |
| 12316 | + | |
| 12317 | + | |
| 12318 | + | |
| 12319 | + | |
| 12320 | + | |
| 12321 | + | |
| 12322 | + | |
| 12323 | + | |
| 12324 | + | |
| 12325 | + | |
| 12326 | + | |
| 12327 | + | |
| 12328 | + | |
| 12329 | + | |
| 12330 | + | |
| 12331 | + | |
| 12332 | + | |
| 12333 | + | |
12280 | 12334 | | |
12281 | 12335 | | |
12282 | 12336 | | |
| |||
12285 | 12339 | | |
12286 | 12340 | | |
12287 | 12341 | | |
12288 | | - | |
12289 | 12342 | | |
12290 | | - | |
| 12343 | + | |
12291 | 12344 | | |
12292 | 12345 | | |
12293 | | - | |
| 12346 | + | |
12294 | 12347 | | |
12295 | 12348 | | |
12296 | 12349 | | |
| |||
12313 | 12366 | | |
12314 | 12367 | | |
12315 | 12368 | | |
12316 | | - | |
12317 | | - | |
| 12369 | + | |
| 12370 | + | |
12318 | 12371 | | |
12319 | 12372 | | |
12320 | 12373 | | |
| |||
12326 | 12379 | | |
12327 | 12380 | | |
12328 | 12381 | | |
12329 | | - | |
| 12382 | + | |
12330 | 12383 | | |
12331 | 12384 | | |
12332 | 12385 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
531 | 531 | | |
532 | 532 | | |
533 | 533 | | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
534 | 541 | | |
535 | 542 | | |
536 | 543 | | |
| |||
551 | 558 | | |
552 | 559 | | |
553 | 560 | | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
554 | 568 | | |
555 | 569 | | |
556 | 570 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
| 66 | + | |
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| |||
197 | 197 | | |
198 | 198 | | |
199 | 199 | | |
200 | | - | |
| 200 | + | |
201 | 201 | | |
202 | | - | |
| 202 | + | |
203 | 203 | | |
204 | 204 | | |
205 | 205 | | |
206 | | - | |
| 206 | + | |
207 | 207 | | |
208 | | - | |
| 208 | + | |
209 | 209 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
313 | 313 | | |
314 | 314 | | |
315 | 315 | | |
| 316 | + | |
316 | 317 | | |
317 | 318 | | |
318 | 319 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | | - | |
| 19 | + | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
0 commit comments
Comments
(0)