Re: danger of stats_temp_directory = /dev/shm

From: Andres Freund <andres(at)2ndquadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Josh Berkus <josh(at)agliodbs(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: danger of stats_temp_directory = /dev/shm
Date: 2013-08-19 19:36:26
Message-ID: 20130819193626.GE26775@awork2.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2013-08-19 15:25:38 -0400, Tom Lane wrote:
> Andres Freund <andres(at)2ndquadrant(dot)com> writes:
> > Hm. Is a check like that actually sufficient? The idea of setting
> > stats_temp_directory to /dev/shm/postgres or similar in all of several
> > clusters on one machine doesn't seem to be that far fetched.
>
> Hm. We could fairly easily have the lockfile management code also
> write a postmaster.pid file into the stats_temp_directory, thus claiming
> it in the same way as we do the $PGDATA dir itself. Not sure it's worth
> the trouble though, since we've not heard any field reports of this sort
> of thing.

The reason I think it's more likely is that pg_stats_directory, to be
useful, really needs something like a ramdisk/tmpfs. Which is annoying
to create in a persistent fashion...
Very likely doing so would cause hard to diagnose planner issues using
completely absurd statistics. Not sure how often it would get properly
diagnosed.

But:

> Maybe we're overreacting to this issue for stats_temp_directory,
> and tightening up the deletion code is a sufficient fix.

You very well might be right. Just wanted to raise the issue.

Greetings,

Andres Freund

--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jon Nelson 2013-08-19 19:40:07 Re: 9.4 regression
Previous Message Tom Lane 2013-08-19 19:25:38 Re: danger of stats_temp_directory = /dev/shm