forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitd661532
committed
Also trigger restartpoints based on max_wal_size on standby.
When archive recovery and restartpoints were initially introduced,checkpoint_segments was ignored on the grounds that the files restored fromarchive don't consume any space in the recovery server. That was changed inlater releases, but even then it was arguably a feature rather than a bug,as performing restartpoints as often as checkpoints during normal operationmight be excessive, but you might nevertheless not want to waste a lot ofspace for pre-allocated WAL by setting checkpoint_segments to a high value.But now that we have separate min_wal_size and max_wal_size settings, youcan bound WAL usage with max_wal_size, and still avoid consuming excessivespace usage by setting min_wal_size to a lower value, so that argument ismoot.There are still some issues with actually limiting the space usage tomax_wal_size: restartpoints in recovery can only start after seeing thecheckpoint record, while a checkpoint starts flushing buffers as soon asthe redo-pointer is set. Restartpoint is paced to happen at the sameleisurily speed, determined by checkpoint_completion_target, as checkpoints,but because they are started later, max_wal_size can be exceeded by uptoone checkpoint cycle's worth of WAL, depending oncheckpoint_completion_target. But that seems better than not trying at all,and max_wal_size is a soft limit anyway.The documentation already claimed that max_wal_size is obeyed in recovery,so this just fixes the behaviour to match the docs. However, add someweasel-words there to mention that max_wal_size may well be exceeded bysome amount in recovery.1 parent6ab4d38 commitd661532
File tree
3 files changed
+29
-13
lines changed- doc/src/sgml
- src/backend
- access/transam
- postmaster
3 files changed
+29
-13
lines changedLines changed: 5 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
590 | 590 |
| |
591 | 591 |
| |
592 | 592 |
| |
593 |
| - | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
594 | 598 |
| |
595 | 599 |
| |
596 | 600 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
10943 | 10943 |
| |
10944 | 10944 |
| |
10945 | 10945 |
| |
10946 |
| - | |
| 10946 | + | |
10947 | 10947 |
| |
10948 | 10948 |
| |
10949 | 10949 |
| |
|
Lines changed: 23 additions & 11 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
475 | 475 |
| |
476 | 476 |
| |
477 | 477 |
| |
478 |
| - | |
| 478 | + | |
479 | 479 |
| |
480 | 480 |
| |
481 |
| - | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
482 | 484 |
| |
483 | 485 |
| |
484 | 486 |
| |
| |||
720 | 722 |
| |
721 | 723 |
| |
722 | 724 |
| |
723 |
| - | |
| 725 | + | |
724 | 726 |
| |
725 | 727 |
| |
726 | 728 |
| |
| |||
757 | 759 |
| |
758 | 760 |
| |
759 | 761 |
| |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
760 | 772 |
| |
761 |
| - | |
762 |
| - | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
763 | 776 |
| |
764 |
| - | |
| 777 | + | |
765 | 778 |
| |
766 |
| - | |
767 |
| - | |
768 |
| - | |
769 |
| - | |
770 |
| - | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
771 | 783 |
| |
772 | 784 |
| |
773 | 785 |
| |
|
0 commit comments
Comments
(0)