forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit50f3385
committed
Free disk space for dropped relations on commit.
When committing a transaction that dropped a relation, we previouslytruncated only the first segment file to free up disk space (the onethat won't be unlinked until the next checkpoint).Truncate higher numbered segments too, even though we unlink them oncommit. This frees the disk space immediately, even if other backendshave open file descriptors and might take a long time to get around tohandling shared invalidation events and closing them. Also extend thesame behavior to the first segment, in recovery.Back-patch to all supported releases.Bug: #16663Reported-by: Denis Patron <denis.patron@previnet.it>Reviewed-by: Pavel Borisov <pashkin.elfe@gmail.com>Reviewed-by: Neil Chen <carpenter.nail.cz@gmail.com>Reviewed-by: David Zhang <david.zhang@highgo.ca>Discussion:https://postgr.es/m/16663-fe97ccf9932fc800%40postgresql.org1 parentb2603f1 commit50f3385
1 file changed
+69
-31
lines changedLines changed: 69 additions & 31 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
273 | 273 |
| |
274 | 274 |
| |
275 | 275 |
| |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
276 | 311 |
| |
277 | 312 |
| |
278 | 313 |
| |
| |||
286 | 321 |
| |
287 | 322 |
| |
288 | 323 |
| |
289 |
| - | |
290 | 324 |
| |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
291 | 330 |
| |
| 331 | + | |
| 332 | + | |
| 333 | + | |
292 | 334 |
| |
293 |
| - | |
294 |
| - | |
295 |
| - | |
296 |
| - | |
297 |
| - | |
298 |
| - | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
299 | 344 |
| |
300 | 345 |
| |
301 | 346 |
| |
302 |
| - | |
303 |
| - | |
304 |
| - | |
305 |
| - | |
306 |
| - | |
307 |
| - | |
308 |
| - | |
309 |
| - | |
310 |
| - | |
311 |
| - | |
312 |
| - | |
313 |
| - | |
314 |
| - | |
315 |
| - | |
316 |
| - | |
317 |
| - | |
318 |
| - | |
319 |
| - | |
320 |
| - | |
| 347 | + | |
| 348 | + | |
321 | 349 |
| |
322 | 350 |
| |
323 | 351 |
| |
| |||
337 | 365 |
| |
338 | 366 |
| |
339 | 367 |
| |
340 |
| - | |
341 |
| - | |
342 |
| - | |
343 |
| - | |
| 368 | + | |
| 369 | + | |
344 | 370 |
| |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
345 | 383 |
| |
| 384 | + | |
346 | 385 |
| |
347 |
| - | |
348 | 386 |
| |
349 | 387 |
| |
350 | 388 |
| |
|
0 commit comments
Comments
(0)