forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitfba105b
committed
Use "transient" files for blind writes, take 2
"Blind writes" are a mechanism to push buffers down to disk whenevicting them; since they may belong to different databases than the onea backend is connected to, the backend does not necessarily have arelation to link them to, and thus no way to blow them away. We werekeeping those files open indefinitely, which would cause a problem ifthe underlying table was deleted, because the operating system would notbe able to reclaim the disk space used by those files.To fix, have bufmgr mark such files as transient to smgr; the lowerlayer is allowed to close the file descriptor when the currenttransaction ends. We must be careful to have any other access of thefile to remove the transient markings, to prevent unnecessary expensivesystem calls when evicting buffers belonging to our own database (whichfiles we're likely to require again soon.)This commit fixes a bug in the previous one, which neglected to cleanlyhandle the LRU ring that fd.c uses to manage open files, and caused anunacceptable failure just before beta2 and was thus reverted.1 parent3d114b6 commitfba105b
6 files changed
+102
-28
lines changedLines changed: 8 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1834 | 1834 |
| |
1835 | 1835 |
| |
1836 | 1836 |
| |
1837 |
| - | |
| 1837 | + | |
| 1838 | + | |
| 1839 | + | |
| 1840 | + | |
1838 | 1841 |
| |
1839 | 1842 |
| |
1840 | 1843 |
| |
| |||
1856 | 1859 |
| |
1857 | 1860 |
| |
1858 | 1861 |
| |
1859 |
| - | |
| 1862 | + | |
1860 | 1863 |
| |
| 1864 | + | |
1861 | 1865 |
| |
| 1866 | + | |
| 1867 | + | |
1862 | 1868 |
| |
1863 | 1869 |
| |
1864 | 1870 |
| |
|
Lines changed: 65 additions & 26 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
125 | 125 |
| |
126 | 126 |
| |
127 | 127 |
| |
| 128 | + | |
| 129 | + | |
128 | 130 |
| |
129 |
| - | |
130 |
| - | |
131 |
| - | |
132 |
| - | |
133 |
| - | |
| 131 | + | |
| 132 | + | |
134 | 133 |
| |
135 | 134 |
| |
136 | 135 |
| |
| |||
591 | 590 |
| |
592 | 591 |
| |
593 | 592 |
| |
| 593 | + | |
594 | 594 |
| |
595 | 595 |
| |
596 | 596 |
| |
| |||
953 | 953 |
| |
954 | 954 |
| |
955 | 955 |
| |
956 |
| - | |
| 956 | + | |
957 | 957 |
| |
958 | 958 |
| |
959 | 959 |
| |
| |||
1026 | 1026 |
| |
1027 | 1027 |
| |
1028 | 1028 |
| |
| 1029 | + | |
| 1030 | + | |
| 1031 | + | |
| 1032 | + | |
| 1033 | + | |
| 1034 | + | |
| 1035 | + | |
| 1036 | + | |
| 1037 | + | |
| 1038 | + | |
| 1039 | + | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
| 1046 | + | |
| 1047 | + | |
1029 | 1048 |
| |
1030 | 1049 |
| |
1031 | 1050 |
| |
| |||
1778 | 1797 |
| |
1779 | 1798 |
| |
1780 | 1799 |
| |
1781 |
| - | |
1782 |
| - | |
| 1800 | + | |
| 1801 | + | |
| 1802 | + | |
1783 | 1803 |
| |
1784 | 1804 |
| |
1785 | 1805 |
| |
| |||
1802 | 1822 |
| |
1803 | 1823 |
| |
1804 | 1824 |
| |
1805 |
| - | |
| 1825 | + | |
| 1826 | + | |
| 1827 | + | |
| 1828 | + | |
1806 | 1829 |
| |
1807 | 1830 |
| |
1808 | 1831 |
| |
| |||
1819 | 1842 |
| |
1820 | 1843 |
| |
1821 | 1844 |
| |
1822 |
| - | |
| 1845 | + | |
1823 | 1846 |
| |
1824 | 1847 |
| |
1825 | 1848 |
| |
1826 | 1849 |
| |
1827 | 1850 |
| |
1828 | 1851 |
| |
1829 |
| - | |
| 1852 | + | |
1830 | 1853 |
| |
1831 |
| - | |
1832 |
| - | |
1833 |
| - | |
1834 |
| - | |
1835 |
| - | |
1836 |
| - | |
1837 |
| - | |
1838 |
| - | |
1839 |
| - | |
1840 |
| - | |
| 1854 | + | |
| 1855 | + | |
| 1856 | + | |
| 1857 | + | |
| 1858 | + | |
| 1859 | + | |
| 1860 | + | |
| 1861 | + | |
| 1862 | + | |
| 1863 | + | |
| 1864 | + | |
| 1865 | + | |
| 1866 | + | |
| 1867 | + | |
| 1868 | + | |
| 1869 | + | |
| 1870 | + | |
| 1871 | + | |
| 1872 | + | |
| 1873 | + | |
1841 | 1874 |
| |
1842 |
| - | |
1843 |
| - | |
1844 |
| - | |
1845 |
| - | |
| 1875 | + | |
| 1876 | + | |
| 1877 | + | |
| 1878 | + | |
| 1879 | + | |
| 1880 | + | |
| 1881 | + | |
| 1882 | + | |
| 1883 | + | |
| 1884 | + | |
1846 | 1885 |
| |
1847 | 1886 |
| |
1848 | 1887 |
| |
1849 | 1888 |
| |
1850 |
| - | |
| 1889 | + | |
1851 | 1890 |
| |
1852 | 1891 |
| |
1853 | 1892 |
| |
|
Lines changed: 9 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
288 | 288 |
| |
289 | 289 |
| |
290 | 290 |
| |
| 291 | + | |
| 292 | + | |
| 293 | + | |
291 | 294 |
| |
292 | 295 |
| |
293 | 296 |
| |
| |||
542 | 545 |
| |
543 | 546 |
| |
544 | 547 |
| |
| 548 | + | |
| 549 | + | |
| 550 | + | |
545 | 551 |
| |
546 | 552 |
| |
547 | 553 |
| |
| |||
1556 | 1562 |
| |
1557 | 1563 |
| |
1558 | 1564 |
| |
| 1565 | + | |
| 1566 | + | |
| 1567 | + | |
1559 | 1568 |
| |
1560 | 1569 |
| |
1561 | 1570 |
| |
|
Lines changed: 17 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
165 | 165 |
| |
166 | 166 |
| |
167 | 167 |
| |
| 168 | + | |
168 | 169 |
| |
169 | 170 |
| |
170 | 171 |
| |
171 | 172 |
| |
172 | 173 |
| |
173 | 174 |
| |
| 175 | + | |
| 176 | + | |
| 177 | + | |
174 | 178 |
| |
175 | 179 |
| |
176 | 180 |
| |
177 | 181 |
| |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
178 | 195 |
| |
179 | 196 |
| |
180 | 197 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
61 | 61 |
| |
62 | 62 |
| |
63 | 63 |
| |
| 64 | + | |
64 | 65 |
| |
65 | 66 |
| |
66 | 67 |
| |
|
Lines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
62 | 62 |
| |
63 | 63 |
| |
64 | 64 |
| |
| 65 | + | |
65 | 66 |
| |
66 | 67 |
| |
67 | 68 |
| |
| |||
74 | 75 |
| |
75 | 76 |
| |
76 | 77 |
| |
| 78 | + | |
77 | 79 |
| |
78 | 80 |
| |
79 | 81 |
| |
|
0 commit comments
Comments
(0)