forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit0dfe3d0
committed
Make checkpoint requests more robust.
Commit6f6a6d8 introduced a delay of up to 2 seconds if we're tryingto request a checkpoint but the checkpointer hasn't started yet (or,much less likely, our kill() call fails). However buildfarm experienceshows that that's not quite enough for slow or heavily-loaded machines.There's no good reason to assume that the checkpointer won't starteventually, so we may as well make the timeout much longer, say 60 sec.However, if the caller didn't say CHECKPOINT_WAIT, it seems like a badidea to be waiting at all, much less for as long as 60 sec. We canremove the need for that, and make this whole thing more robust, byadjusting the code so that the existence of a pending checkpointrequest is clear from the contents of shared memory, and making surethat the checkpointer process will notice it at startup even if it didnot get a signal. In this way there's no need for a non-CHECKPOINT_WAITcall to wait at all; if it can't send the signal, it can nonethelessassume that the checkpointer will eventually service the request.A potential downside of this change is that "kill -INT" on the checkpointerprocess is no longer enough to trigger a checkpoint, should anyone berelying on something so hacky. But there's no obvious reason to do itlike that rather than issuing a plain old CHECKPOINT command, so we'llassume that nobody is. There doesn't seem to be a way to preserve thisundocumented quasi-feature without introducing race conditions.Since a principal reason for messing with this is to prevent intermittentbuildfarm failures, back-patch to all supported branches.Discussion:https://postgr.es/m/27830.1552752475@sss.pgh.pa.us1 parent28988a8 commit0dfe3d0
2 files changed
+36
-27
lines changedLines changed: 33 additions & 25 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
153 | 153 |
| |
154 | 154 |
| |
155 | 155 |
| |
156 |
| - | |
157 | 156 |
| |
158 | 157 |
| |
159 | 158 |
| |
| |||
370 | 369 |
| |
371 | 370 |
| |
372 | 371 |
| |
373 |
| - | |
374 |
| - | |
375 |
| - | |
376 |
| - | |
377 |
| - | |
378 |
| - | |
379 | 372 |
| |
380 | 373 |
| |
381 | 374 |
| |
| |||
389 | 382 |
| |
390 | 383 |
| |
391 | 384 |
| |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
392 | 396 |
| |
393 | 397 |
| |
394 | 398 |
| |
| |||
630 | 634 |
| |
631 | 635 |
| |
632 | 636 |
| |
633 |
| - | |
634 |
| - | |
635 |
| - | |
| 637 | + | |
636 | 638 |
| |
637 |
| - | |
638 |
| - | |
639 |
| - | |
640 |
| - | |
641 |
| - | |
642 |
| - | |
643 |
| - | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
644 | 645 |
| |
645 | 646 |
| |
646 | 647 |
| |
| |||
843 | 844 |
| |
844 | 845 |
| |
845 | 846 |
| |
846 |
| - | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
847 | 851 |
| |
848 | 852 |
| |
849 | 853 |
| |
| |||
984 | 988 |
| |
985 | 989 |
| |
986 | 990 |
| |
987 |
| - | |
| 991 | + | |
988 | 992 |
| |
989 | 993 |
| |
990 | 994 |
| |
991 | 995 |
| |
992 | 996 |
| |
993 | 997 |
| |
994 |
| - | |
995 |
| - | |
996 |
| - | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
| 1003 | + | |
997 | 1004 |
| |
| 1005 | + | |
998 | 1006 |
| |
999 | 1007 |
| |
1000 | 1008 |
| |
1001 | 1009 |
| |
1002 |
| - | |
| 1010 | + | |
1003 | 1011 |
| |
1004 | 1012 |
| |
1005 |
| - | |
| 1013 | + | |
1006 | 1014 |
| |
1007 | 1015 |
| |
1008 | 1016 |
| |
1009 | 1017 |
| |
1010 | 1018 |
| |
1011 |
| - | |
| 1019 | + | |
1012 | 1020 |
| |
1013 | 1021 |
| |
1014 | 1022 |
| |
|
Lines changed: 3 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
215 | 215 |
| |
216 | 216 |
| |
217 | 217 |
| |
| 218 | + | |
218 | 219 |
| |
219 |
| - | |
220 |
| - | |
| 220 | + | |
| 221 | + | |
221 | 222 |
| |
222 | 223 |
| |
223 | 224 |
| |
|
0 commit comments
Comments
(0)