Re: stats_temp_directory conflicts

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Noah Misch <noah(at)leadboat(dot)com>
Cc: Andrew Dunstan <andrew(dot)dunstan(at)2ndquadrant(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: stats_temp_directory conflicts
Date: 2018-12-31 00:47:05
Message-ID: 21648.1546217225@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Noah Misch <noah(at)leadboat(dot)com> writes:
> I'm thinking the server should manage this; during startup, create
> $stats_temp_directory/PostgreSQL.$postmaster_pid and store each stats file
> therein.

+1

> Just before creating that directory, scan $stats_temp_directory and
> delete subdirectories that no longer correspond to live PIDs.

Hm, seems potentially racy, if multiple postmasters are starting
at the same time. The only one you can be *sure* is dead is one
with your own PID.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ian Barwick 2018-12-31 00:50:29 Re: Minor comment fix for pg_config_manual.h
Previous Message Noah Misch 2018-12-31 00:28:15 stats_temp_directory conflicts