Skip site navigation (1) Skip section navigation (2)

Re: create tablespace fails silently, or succeeds improperly

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Stephen Frost <sfrost(at)snowman(dot)net>, Bruce Momjian <bruce(at)momjian(dot)us>, Dave Cramer <pg(at)fastcrypt(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: create tablespace fails silently, or succeeds improperly
Date: 2010-12-11 18:23:10
Message-ID: AANLkTikRpjxw6m0TPi+sYtGdrO0xaaAGcFgkVXjRrKjS@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-hackers
On Sat, Dec 11, 2010 at 1:20 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Robert Haas <robertmhaas(at)gmail(dot)com> writes:
>> On Sat, Dec 11, 2010 at 10:56 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>>> OK.  Is there any value in doing mkdir -p in WAL-recovery execution of
>>> CREATE TABLESPACE but not regular execution?
>
>> I don't think so.  If someone creates a directory that is not fsync'd,
>> and then creates a subdirectory and puts a tablespace on it, and then
>> crashes after this has been WAL-logged but before the directory
>> entries have hit the disk, well, unlucky for them, but that's a
>> vanishingly rare situation.
>
> I'm not really thinking about crash recovery, but replication slaves.
> Omitting to create the tablespace location directories on slaves
> doesn't seem far-fetched at all.  Of course, it's likely that
> the slave server will lack permissions to create in the location
> directory's parent; but if it can, the outcome shouldn't be too
> unreasonable.

Creating the tablespace directory itself would be reasonable, but
recursing all the way up seems dubious.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2010-12-11 18:38:28
Subject: Re: create tablespace fails silently, or succeeds improperly
Previous:From: Tom LaneDate: 2010-12-11 18:20:59
Subject: Re: create tablespace fails silently, or succeeds improperly

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group