pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrew Dunstan <andrew@dunslane.net>
To: Amit Kapila <amit.kapila16@gmail.com>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: hlinnaka <hlinnaka@iki.fi>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Subject: Re: Re: [COMMITTERS] pgsql: Map basebackup tablespaces using a tablespace_map file
Date: Sat, 23 May 2015 11:58:58 -0400
Message-ID: <5560A3C2.6070204@dunslane.net> (raw)
In-Reply-To: <CAA4eK1LBQBPvz+pS_fiNvdmm3vWf-vRWNCr_VUuu1aKPjcE1WA@mail.gmail.com>
References: <E1YsASW-0000Aa-Ut@gemulon.postgresql.org>
	<55520F33.401@iki.fi>
	<55521D27.3010705@dunslane.net>
	<CAA4eK1JuSn29N6SSrk19yoR160KrdObzgyLXyqH2QSGC+wdoRQ@mail.gmail.com>
	<5553B6B5.6040804@dunslane.net>
	<CAA4eK1K3ujrY79ki+_Okqs9WUnvs7NLLyk3=GGS4uN7A3URA7Q@mail.gmail.com>
	<CA+TgmobCLoZiPHQBSiBsp+nhZZePoib6ETvjpXM-Dabj8VHMdw@mail.gmail.com>
	<5554D470.1080107@dunslane.net>
	<CAA4eK1KEFoTJ8kRxsTid=ZRx8Rd593B+86-GCDDey5s2Mqqw_g@mail.gmail.com>
	<CAA4eK1LBQBPvz+pS_fiNvdmm3vWf-vRWNCr_VUuu1aKPjcE1WA@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>


On 05/23/2015 01:29 AM, Amit Kapila wrote:
> On Fri, May 15, 2015 at 11:51 AM, Amit Kapila <amit.kapila16@gmail.com 
> <mailto:amit.kapila16@gmail.com>> wrote:
> >
> > On Thu, May 14, 2015 at 10:29 PM, Andrew Dunstan 
> <andrew@dunslane.net <mailto:andrew@dunslane.net>> wrote:
> > >
> > >
> > > On 05/14/2015 10:52 AM, Robert Haas wrote:
> > >>
> > >> On Thu, May 14, 2015 at 12:12 AM, Amit Kapila 
> <amit.kapila16@gmail.com <mailto:amit.kapila16@gmail.com>> wrote:
> > >>>
> > >>> On Thu, May 14, 2015 at 2:10 AM, Andrew Dunstan 
> <andrew@dunslane.net <mailto:andrew@dunslane.net>> wrote:
> > >>>>
> > >>>> How about if we simply abort if we find a non-symlink where we 
> want the
> > >>>> symlink to be, and only remove something that is actually a 
> symlink (or a
> > >>>> junction point, which is more or less the same thing)?
> > >>>
> > >>> We can do that way and for that I think we need to use rmdir
> > >>> instead of rmtree in the code being discussed (recovery path),
> > >>> OTOH we should try to minimize the errors raised during
> > >>> recovery.
> > >>
> > >> I'm not sure I understand this issue in detail, but why would using
> > >> rmtree() on something you expect to be a symlink ever be a good idea?
> > >> It seems like if things are the way you expect them to be, it has no
> > >> benefit, but if they are different from what you expect, you might
> > >> blow away a ton of important data.
> > >>
> > >> Maybe I am just confused.
> > >>
> > >
> > >
> > > The suggestion is to get rid of using rmtree. Instead, if we find 
> a non-symlink in pg_tblspc we'll make the user clean it up before we 
> can continue. So your instinct is in tune with my suggestion.
> > >
> >
> > Find the patch which gets rid of rmtree usage.  I have made it as
> > a separate function because the same code is used from
> > create_tablespace_directories() as well.  I thought of extending the
> > same API for using it from destroy_tablespace_directories() as well,
> > but due to special handling (especially for ENOENT) in that function,
> > I left it as of now.
> >
>
> Does it make sense to track this in 9.5 Open Items [1]?
>
>
> [1] - https://wiki.postgresql.org/wiki/PostgreSQL_9.5_Open_Items
>
>


Sure. It's on my list of things to get to, but by all means put it there.

cheers

andrew



-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



view thread (74+ messages)  latest in thread

Message-ID: <5560A3C2.6070204@dunslane.net>
Permalink:  ../5560A3C2.6070204@dunslane.net/
Also on:    postgresql.org/message-id/5560A3C2.6070204@dunslane.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: andrew@dunslane.net, amit.kapila16@gmail.com, robertmhaas@gmail.com, hlinnaka@iki.fi, pgsql-hackers@postgresql.org
  Subject: Re: [COMMITTERS] pgsql: Map basebackup tablespaces using a tablespace_map file
  In-Reply-To: <5560A3C2.6070204@dunslane.net>
  References: <E1YsASW-0000Aa-Ut@gemulon.postgresql.org> <55520F33.401@iki.fi> <55521D27.3010705@dunslane.net> <CAA4eK1JuSn29N6SSrk19yoR160KrdObzgyLXyqH2QSGC+wdoRQ@mail.gmail.com> <5553B6B5.6040804@dunslane.net> <CAA4eK1K3ujrY79ki+_Okqs9WUnvs7NLLyk3=GGS4uN7A3URA7Q@mail.gmail.com> <CA+TgmobCLoZiPHQBSiBsp+nhZZePoib6ETvjpXM-Dabj8VHMdw@mail.gmail.com> <5554D470.1080107@dunslane.net> <CAA4eK1KEFoTJ8kRxsTid=ZRx8Rd593B+86-GCDDey5s2Mqqw_g@mail.gmail.com> <CAA4eK1LBQBPvz+pS_fiNvdmm3vWf-vRWNCr_VUuu1aKPjcE1WA@mail.gmail.com> <5560A3C2.6070204@dunslane.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox