Re: BUG #16663: DROP INDEX did not free up disk space: idle connection hold file marked as deleted
Pavel Borisov <pashkin.elfe@gmail.com>
From: Pavel Borisov <pashkin.elfe@gmail.com>
To: Neil Chen <carpenter.nail.cz@gmail.com>
Cc: Postgres hackers <pgsql-hackers@lists.postgresql.org>, Thomas Munro <thomas.munro@gmail.com>
Date: 2020-11-19T15:54:54Z
Lists: pgsql-bugs, pgsql-hackers
>
> One thing that doesn't matter is that the modify here seems unnecessary,
> right?
>
> > mdunlinkfork(RelFileNodeBackend rnode, ForkNumber forkNum, bool isRedo)
> > {
> > char *path;
> > - int ret;
> > + int ret = 0;
> > path = relpath(rnode, forkNum
I suppose it is indeed necessary as otherwise the result of the comparison
is not defined in case of 'else' block in the mdunlinkfork() :
346 else
347 {
348 /* Prevent other backends' fds from holding on to the disk
space */
349 do_truncate(path);
.....
356 * Delete any additional segments.
357 */
358 if (ret >= 0)
----------^^^^^^^
--
Best regards,
Pavel Borisov
Postgres Professional: http://postgrespro.com <http://www.postgrespro.com>
Commits
-
Use truncate(2) where appropriate.
- 57faaf376e19 14.0 landed
-
Free disk space for dropped relations on commit.
- e00928de8d22 9.5.25 landed
- d0bbe2122099 9.6.21 landed
- 22701755dc64 10.16 landed
- d5706ad7b70a 11.11 landed
- 50f338574242 12.6 landed
- fd3a75d820a4 13.2 landed
- 9f35f943732e 14.0 landed
-
Rename the "point is strictly above/below point" comparison operators.
- 0cc993278888 14.0 cited