Commit dee663f
committed
Defer flushing of SLRU files.
Previously, we called fsync() after writing out individual pg_xact,
pg_multixact and pg_commit_ts pages due to cache pressure, leading to
regular I/O stalls in user backends and recovery. Collapse requests for
the same file into a single system call as part of the next checkpoint,
as we already did for relation files, using the infrastructure developed
by commit 3eb77eb. This can cause a significant improvement to
recovery performance, especially when it's otherwise CPU-bound.
Hoist ProcessSyncRequests() up into CheckPointGuts() to make it clearer
that it applies to all the SLRU mini-buffer-pools as well as the main
buffer pool. Rearrange things so that data collected in CheckpointStats
includes SLRU activity.
Also remove the Shutdown{CLOG,CommitTS,SUBTRANS,MultiXact}() functions,
because they were redundant after the shutdown checkpoint that
immediately precedes them. (I'm not sure if they were ever needed, but
they aren't now.)
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> (parts)
Tested-by: Jakub Wartak <Jakub.Wartak@tomtom.com>
Discussion: https://postgr.es/m/CA+hUKGLJ=84YT+NvhkEEDAuUtVHMfQ9i-N7k_o50JmQ6Rpj_OQ@mail.gmail.com1 parent ca7f8e2 commit dee663f
File tree
16 files changed
+252
-172
lines changed- src
- backend
- access/transam
- commands
- storage
- buffer
- lmgr
- sync
- include
- access
- storage
- tools/pgindent
16 files changed
+252
-172
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
| |||
691 | 692 | | |
692 | 693 | | |
693 | 694 | | |
694 | | - | |
| 695 | + | |
| 696 | + | |
695 | 697 | | |
696 | 698 | | |
697 | 699 | | |
| |||
808 | 810 | | |
809 | 811 | | |
810 | 812 | | |
811 | | - | |
812 | | - | |
813 | | - | |
814 | | - | |
815 | | - | |
816 | | - | |
817 | | - | |
818 | | - | |
819 | | - | |
820 | | - | |
821 | | - | |
822 | | - | |
823 | | - | |
824 | | - | |
825 | | - | |
826 | | - | |
827 | | - | |
828 | | - | |
829 | | - | |
830 | 813 | | |
831 | 814 | | |
832 | 815 | | |
833 | 816 | | |
834 | 817 | | |
835 | 818 | | |
836 | | - | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
837 | 824 | | |
838 | | - | |
| 825 | + | |
839 | 826 | | |
840 | 827 | | |
841 | 828 | | |
| |||
1026 | 1013 | | |
1027 | 1014 | | |
1028 | 1015 | | |
| 1016 | + | |
| 1017 | + | |
| 1018 | + | |
| 1019 | + | |
| 1020 | + | |
| 1021 | + | |
| 1022 | + | |
| 1023 | + | |
| 1024 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
555 | 555 | | |
556 | 556 | | |
557 | 557 | | |
558 | | - | |
| 558 | + | |
| 559 | + | |
559 | 560 | | |
560 | 561 | | |
561 | 562 | | |
| |||
798 | 799 | | |
799 | 800 | | |
800 | 801 | | |
801 | | - | |
802 | | - | |
803 | | - | |
804 | | - | |
805 | | - | |
806 | | - | |
807 | | - | |
808 | | - | |
809 | | - | |
810 | | - | |
811 | | - | |
812 | | - | |
813 | | - | |
814 | | - | |
815 | | - | |
816 | | - | |
817 | 802 | | |
818 | 803 | | |
819 | 804 | | |
820 | 805 | | |
821 | 806 | | |
822 | 807 | | |
823 | | - | |
824 | | - | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
825 | 814 | | |
826 | 815 | | |
827 | 816 | | |
| |||
1077 | 1066 | | |
1078 | 1067 | | |
1079 | 1068 | | |
| 1069 | + | |
| 1070 | + | |
| 1071 | + | |
| 1072 | + | |
| 1073 | + | |
| 1074 | + | |
| 1075 | + | |
| 1076 | + | |
| 1077 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1831 | 1831 | | |
1832 | 1832 | | |
1833 | 1833 | | |
1834 | | - | |
| 1834 | + | |
| 1835 | + | |
1835 | 1836 | | |
1836 | 1837 | | |
1837 | 1838 | | |
1838 | | - | |
| 1839 | + | |
| 1840 | + | |
1839 | 1841 | | |
1840 | 1842 | | |
1841 | 1843 | | |
| |||
2100 | 2102 | | |
2101 | 2103 | | |
2102 | 2104 | | |
2103 | | - | |
2104 | | - | |
2105 | | - | |
2106 | | - | |
2107 | | - | |
2108 | | - | |
2109 | | - | |
2110 | | - | |
2111 | | - | |
2112 | | - | |
2113 | | - | |
2114 | | - | |
2115 | | - | |
2116 | 2105 | | |
2117 | 2106 | | |
2118 | 2107 | | |
| |||
2143 | 2132 | | |
2144 | 2133 | | |
2145 | 2134 | | |
2146 | | - | |
2147 | | - | |
2148 | | - | |
| 2135 | + | |
| 2136 | + | |
| 2137 | + | |
| 2138 | + | |
| 2139 | + | |
| 2140 | + | |
| 2141 | + | |
2149 | 2142 | | |
2150 | 2143 | | |
2151 | 2144 | | |
| |||
2728 | 2721 | | |
2729 | 2722 | | |
2730 | 2723 | | |
2731 | | - | |
2732 | | - | |
2733 | | - | |
2734 | | - | |
2735 | | - | |
| 2724 | + | |
2736 | 2725 | | |
2737 | | - | |
2738 | | - | |
| 2726 | + | |
| 2727 | + | |
2739 | 2728 | | |
2740 | 2729 | | |
2741 | 2730 | | |
| |||
3386 | 3375 | | |
3387 | 3376 | | |
3388 | 3377 | | |
| 3378 | + | |
| 3379 | + | |
| 3380 | + | |
| 3381 | + | |
| 3382 | + | |
| 3383 | + | |
| 3384 | + | |
| 3385 | + | |
| 3386 | + | |
| 3387 | + | |
| 3388 | + | |
| 3389 | + | |
| 3390 | + | |
| 3391 | + | |
| 3392 | + | |
| 3393 | + | |
| 3394 | + | |
| 3395 | + | |
0 commit comments