forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit215ac4a
committed
Truncate pg_multixact/'s contents during crash recovery
Commit9dc842f of 8.2 era prevented MultiXact truncation during crashrecovery, because there was no guarantee that enough state had beensetup, and because it wasn't deemed to be a good idea to remove dataduring crash recovery anyway. Since then, due to Hot-Standby, streamingreplication and PITR, the amount of time a cluster can spend doing crashrecovery has increased significantly, to the point that a cluster mayeven never come out of it. This has made not truncating the content ofpg_multixact/ not defensible anymore.To fix, take care to setup enough state for multixact truncation beforecrash recovery starts (easy since checkpoints contain the requiredinformation), and move the current end-of-recovery actions to a newTrimMultiXact() function, analogous to TrimCLOG().At some later point, this should probably done similarly to the wayclog.c is doing it, which is to just WAL log truncations, but we can'tdo that for the back branches.Back-patch to 9.0. 8.4 also has the problem, but since there's no hotstandby there, it's much less pressing. In 9.2 and earlier, this patchis simpler than in newer branches, because multixact access duringrecovery isn't required. Add appropriate checks to make sure that's nothappening.Andres Freund1 parentf5f92bd commit215ac4a
File tree
3 files changed
+70
-14
lines changed- src
- backend/access/transam
- include/access
3 files changed
+70
-14
lines changedLines changed: 42 additions & 11 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1768 | 1768 |
| |
1769 | 1769 |
| |
1770 | 1770 |
| |
1771 |
| - | |
1772 |
| - | |
1773 |
| - | |
1774 |
| - | |
1775 |
| - | |
| 1771 | + | |
| 1772 | + | |
1776 | 1773 |
| |
1777 | 1774 |
| |
1778 | 1775 |
| |
| 1776 | + | |
| 1777 | + | |
| 1778 | + | |
| 1779 | + | |
| 1780 | + | |
| 1781 | + | |
| 1782 | + | |
| 1783 | + | |
| 1784 | + | |
| 1785 | + | |
| 1786 | + | |
| 1787 | + | |
| 1788 | + | |
| 1789 | + | |
| 1790 | + | |
| 1791 | + | |
| 1792 | + | |
| 1793 | + | |
| 1794 | + | |
| 1795 | + | |
| 1796 | + | |
| 1797 | + | |
| 1798 | + | |
| 1799 | + | |
| 1800 | + | |
| 1801 | + | |
1779 | 1802 |
| |
1780 | 1803 |
| |
1781 | 1804 |
| |
| |||
1785 | 1808 |
| |
1786 | 1809 |
| |
1787 | 1810 |
| |
1788 |
| - | |
| 1811 | + | |
| 1812 | + | |
| 1813 | + | |
1789 | 1814 |
| |
1790 | 1815 |
| |
1791 | 1816 |
| |
| |||
1794 | 1819 |
| |
1795 | 1820 |
| |
1796 | 1821 |
| |
1797 |
| - | |
| 1822 | + | |
1798 | 1823 |
| |
1799 | 1824 |
| |
1800 | 1825 |
| |
| |||
1824 | 1849 |
| |
1825 | 1850 |
| |
1826 | 1851 |
| |
1827 |
| - | |
| 1852 | + | |
1828 | 1853 |
| |
1829 | 1854 |
| |
1830 | 1855 |
| |
| |||
2258 | 2283 |
| |
2259 | 2284 |
| |
2260 | 2285 |
| |
2261 |
| - | |
2262 |
| - | |
2263 |
| - | |
| 2286 | + | |
| 2287 | + | |
| 2288 | + | |
| 2289 | + | |
| 2290 | + | |
| 2291 | + | |
| 2292 | + | |
| 2293 | + | |
| 2294 | + | |
2264 | 2295 |
| |
2265 | 2296 |
| |
2266 | 2297 |
| |
|
Lines changed: 27 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
5195 | 5195 |
| |
5196 | 5196 |
| |
5197 | 5197 |
| |
| 5198 | + | |
| 5199 | + | |
| 5200 | + | |
| 5201 | + | |
| 5202 | + | |
| 5203 | + | |
| 5204 | + | |
| 5205 | + | |
5198 | 5206 |
| |
5199 | 5207 |
| |
5200 | 5208 |
| |
| |||
5395 | 5403 |
| |
5396 | 5404 |
| |
5397 | 5405 |
| |
5398 |
| - | |
5399 |
| - | |
| 5406 | + | |
| 5407 | + | |
| 5408 | + | |
5400 | 5409 |
| |
5401 | 5410 |
| |
5402 | 5411 |
| |
| |||
6061 | 6070 |
| |
6062 | 6071 |
| |
6063 | 6072 |
| |
6064 |
| - | |
6065 | 6073 |
| |
| 6074 | + | |
6066 | 6075 |
| |
6067 | 6076 |
| |
6068 | 6077 |
| |
| |||
7459 | 7468 |
| |
7460 | 7469 |
| |
7461 | 7470 |
| |
| 7471 | + | |
| 7472 | + | |
| 7473 | + | |
| 7474 | + | |
| 7475 | + | |
| 7476 | + | |
| 7477 | + | |
| 7478 | + | |
| 7479 | + | |
| 7480 | + | |
| 7481 | + | |
| 7482 | + | |
| 7483 | + | |
| 7484 | + | |
| 7485 | + | |
7462 | 7486 |
| |
7463 | 7487 |
| |
7464 | 7488 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
98 | 98 |
| |
99 | 99 |
| |
100 | 100 |
| |
| 101 | + | |
101 | 102 |
| |
102 | 103 |
| |
103 | 104 |
| |
|
0 commit comments
Comments
(0)