Re: danger of stats_temp_directory = /dev/shm

From: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Josh Berkus <josh(at)agliodbs(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: danger of stats_temp_directory = /dev/shm
Date: 2013-08-20 03:02:14
Message-ID: CAMkU=1zGOsp=a_tSjKgSqAjOWDe-9JKzUf5MurTySyU+QB39aA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Monday, August 19, 2013, Alvaro Herrera wrote:

> Tom Lane wrote:
> > Alvaro Herrera <alvherre(at)2ndquadrant(dot)com <javascript:;>> writes:
>
> > > Here's the second attachment.
> >
> > This looks good except that it can't tell "db_123.statfoo" isn't a match.
> > The scan limit/buffer size needs to be greater than the longest string
> > you care about, not only equal to. I think strcmp not strncmp would be
> > better coding, too. Please fix that and commit -- I think this part
> > is pretty noncontroversial.
>
> Pushed with those fixes, thanks. I noticed we also needed to match
> files global.stat and global.tmp. Also I added another conversion to
> the sscanf pattern, to ignore files named "db_1234.tmp.foo" and such
> (i.e. stuff after whitespace).
>

Thanks. I did not attack this with malice, but I did throw some casual
stupidity at it (setting the temp directory to the same as the absolute
path of the data directory) and it managed to go through crash recovery
successfully, while HEAD^ completely destroyed itself.

One oddity I observed is that the first time I tested it (by doing kill -9
on the checkpointer) it failed to come back up automatically, claiming the
start up process had been signalled with 9 during recovery. When I
manually restarted, it ran through recovery again and started successfully.
However I could not repeat this and can't see how this patch could
possibly cause a regression of this nature, so I'm going to chalk it up to
some bizarre race condition, or operator error.

Cheers,

Jeff

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2013-08-20 03:08:52 Re: ALTER SYSTEM SET command to change postgresql.conf parameters (RE: Proposal for Allow postgresql.conf values to be changed via SQL [review])
Previous Message Stephen Frost 2013-08-20 02:57:28 Re: ALTER SYSTEM SET command to change postgresql.conf parameters (RE: Proposal for Allow postgresql.conf values to be changed via SQL [review])