forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitff3f9c8
committed
Close un-owned SMgrRelations at transaction end.
If an SMgrRelation is not "owned" by a relcache entry, don't allow it tolive past transaction end. This design allows the same SMgrRelation to beused for blind writes of multiple blocks during a transaction, but ensuresthat we don't hold onto such an SMgrRelation indefinitely. Because anSMgrRelation typically corresponds to open file descriptors at the fd.clevel, leaving it open when there's no corresponding relcache entry canmean that we prevent the kernel from reclaiming deleted disk space.(While CacheInvalidateSmgr messages usually fix that, there are caseswhere they're not issued, such as DROP DATABASE. We might want to addsome more sinval messaging for that, but I'd be inclined to keep thistype of logic anyway, since allowing VFDs to accumulate indefinitelyfor blind-written relations doesn't seem like a good idea.)This code replaces a previous attempt towards the same goal that provedto be unreliable. Back-patch to 9.1 where the previous patch was added.1 parent9bacf0e commitff3f9c8
File tree
6 files changed
+92
-3
lines changed- src
- backend
- access/transam
- postmaster
- storage/smgr
- include/storage
6 files changed
+92
-3
lines changedLines changed: 3 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1949 | 1949 |
| |
1950 | 1950 |
| |
1951 | 1951 |
| |
1952 |
| - | |
| 1952 | + | |
1953 | 1953 |
| |
1954 | 1954 |
| |
1955 | 1955 |
| |
| |||
2202 | 2202 |
| |
2203 | 2203 |
| |
2204 | 2204 |
| |
2205 |
| - | |
| 2205 | + | |
2206 | 2206 |
| |
2207 | 2207 |
| |
2208 | 2208 |
| |
| |||
2348 | 2348 |
| |
2349 | 2349 |
| |
2350 | 2350 |
| |
| 2351 | + | |
2351 | 2352 |
| |
2352 | 2353 |
| |
2353 | 2354 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
183 | 183 |
| |
184 | 184 |
| |
185 | 185 |
| |
| 186 | + | |
186 | 187 |
| |
187 | 188 |
| |
188 | 189 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
291 | 291 |
| |
292 | 292 |
| |
293 | 293 |
| |
| 294 | + | |
294 | 295 |
| |
295 | 296 |
| |
296 | 297 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
188 | 188 |
| |
189 | 189 |
| |
190 | 190 |
| |
| 191 | + | |
191 | 192 |
| |
192 | 193 |
| |
193 | 194 |
| |
|
Lines changed: 79 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
76 | 76 |
| |
77 | 77 |
| |
78 | 78 |
| |
| 79 | + | |
79 | 80 |
| |
80 | 81 |
| |
81 | 82 |
| |
| 83 | + | |
| 84 | + | |
82 | 85 |
| |
83 | 86 |
| |
| 87 | + | |
84 | 88 |
| |
85 | 89 |
| |
86 | 90 |
| |
| |||
124 | 128 |
| |
125 | 129 |
| |
126 | 130 |
| |
127 |
| - | |
| 131 | + | |
128 | 132 |
| |
129 | 133 |
| |
130 | 134 |
| |
| |||
144 | 148 |
| |
145 | 149 |
| |
146 | 150 |
| |
| 151 | + | |
147 | 152 |
| |
148 | 153 |
| |
149 | 154 |
| |
| |||
168 | 173 |
| |
169 | 174 |
| |
170 | 175 |
| |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
171 | 180 |
| |
172 | 181 |
| |
173 | 182 |
| |
| |||
182 | 191 |
| |
183 | 192 |
| |
184 | 193 |
| |
| 194 | + | |
| 195 | + | |
| 196 | + | |
185 | 197 |
| |
186 | 198 |
| |
187 | 199 |
| |
188 | 200 |
| |
189 | 201 |
| |
| 202 | + | |
| 203 | + | |
| 204 | + | |
190 | 205 |
| |
191 | 206 |
| |
192 | 207 |
| |
| 208 | + | |
| 209 | + | |
193 | 210 |
| |
194 | 211 |
| |
195 | 212 |
| |
196 | 213 |
| |
197 | 214 |
| |
198 | 215 |
| |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
199 | 248 |
| |
200 | 249 |
| |
201 | 250 |
| |
| |||
219 | 268 |
| |
220 | 269 |
| |
221 | 270 |
| |
| 271 | + | |
| 272 | + | |
| 273 | + | |
222 | 274 |
| |
223 | 275 |
| |
224 | 276 |
| |
| |||
600 | 652 |
| |
601 | 653 |
| |
602 | 654 |
| |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + |
Lines changed: 7 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
33 | 33 |
| |
34 | 34 |
| |
35 | 35 |
| |
| 36 | + | |
| 37 | + | |
| 38 | + | |
36 | 39 |
| |
37 | 40 |
| |
38 | 41 |
| |
| |||
63 | 66 |
| |
64 | 67 |
| |
65 | 68 |
| |
| 69 | + | |
| 70 | + | |
| 71 | + | |
66 | 72 |
| |
67 | 73 |
| |
68 | 74 |
| |
| |||
95 | 101 |
| |
96 | 102 |
| |
97 | 103 |
| |
| 104 | + | |
98 | 105 |
| |
99 | 106 |
| |
100 | 107 |
| |
|
0 commit comments
Comments
(0)