Обсуждение: pgsql: Further thoughts about temp_file_limit patch.

Поиск
Список
Период
Сортировка

pgsql: Further thoughts about temp_file_limit patch.

От
Tom Lane
Дата:
Further thoughts about temp_file_limit patch.

Move FileClose's decrement of temporary_files_size up, so that it will be
executed even if elog() throws an error.  This is reasonable since if the
unlink() fails, the fact the file is still there is not our fault, and we
are going to forget about it anyhow.  So we won't count it against
temp_file_limit anymore.

Update fileSize and temporary_files_size correctly in FileTruncate.
We probably don't have any places that truncate temp files, but fd.c
surely should not assume that.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/9473bb96d0eb7ed73f1bf5269613e6266f64ad85

Modified Files
--------------
src/backend/storage/file/fd.c |   17 +++++++++++++----
1 files changed, 13 insertions(+), 4 deletions(-)


Re: pgsql: Further thoughts about temp_file_limit patch.

От
Cédric Villemain
Дата:
2011/7/17 Tom Lane <tgl@sss.pgh.pa.us>:
> Further thoughts about temp_file_limit patch.
>
> Move FileClose's decrement of temporary_files_size up, so that it will be
> executed even if elog() throws an error.  This is reasonable since if the
> unlink() fails, the fact the file is still there is not our fault, and we
> are going to forget about it anyhow.  So we won't count it against
> temp_file_limit anymore.
>
> Update fileSize and temporary_files_size correctly in FileTruncate.
> We probably don't have any places that truncate temp files, but fd.c
> surely should not assume that.
>
> Branch
> ------
> master
>
> Details
> -------
> http://git.postgresql.org/pg/commitdiff/9473bb96d0eb7ed73f1bf5269613e6266f64ad85
>
> Modified Files
> --------------
> src/backend/storage/file/fd.c |   17 +++++++++++++----
> 1 files changed, 13 insertions(+), 4 deletions(-)
>
>
> --
> Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-committers
>


How does it sound to remove the stat() call used when log_temp_file is
set in favor of fileSize that we now have ?
(I didn't check the code rigth now but the 2 patches do not look to
touch that part of the code)

--
Cédric Villemain               2ndQuadrant
http://2ndQuadrant.fr/     PostgreSQL : Expertise, Formation et Support

Re: pgsql: Further thoughts about temp_file_limit patch.

От
Tom Lane
Дата:
=?ISO-8859-1?Q?C=E9dric_Villemain?= <cedric.villemain.debian@gmail.com> writes:
> How does it sound to remove the stat() call used when log_temp_file is
> set in favor of fileSize that we now have ?

I'd just as soon keep the stat call --- it's relatively cheap and it
guarantees an accurate answer.

            regards, tom lane