pgsql: Fix removal of files in pgstats directories

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix removal of files in pgstats directories
Date: 2013-08-19 21:56:09
Message-ID: E1VBXQn-0006lq-V0@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix removal of files in pgstats directories

Instead of deleting all files in stats_temp_directory and the permanent
directory on a crash, only remove those files that match the pattern of
files we actually write in them, to avoid possibly clobbering existing
unrelated contents of the temporary directory. Per complaint from Jeff
Janes, and subsequent discussion, starting at message
CAMkU=1z9+7RsDODnT4=cDFBRBp8wYQbd_qsLcMtKEf-oFwuOdQ(at)mail(dot)gmail(dot)com

Also, fix a bug in the same routine to avoid removing files from the
permanent directory twice (instead of once from that directory and then
from the temporary directory), also per report from Jeff Janes, in
message
CAMkU=1wbk947=-pAosDMX5VC+sQw9W4ttq6RM9rXu=MjNeEQKA(at)mail(dot)gmail(dot)com

Branch
------
REL9_3_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/db5b49cdd4f481828b227f03b373fbc9bde4301a

Modified Files
--------------
src/backend/postmaster/pgstat.c | 33 ++++++++++++++++++++++++++++-----
1 file changed, 28 insertions(+), 5 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2013-08-19 23:36:13 pgsql: Be more wary of unwanted whitespace in pgstat_reset_remove_files
Previous Message Alvaro Herrera 2013-08-19 21:55:53 pgsql: Fix removal of files in pgstats directories