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: Fri, 05 Jun 2015 00:27:06 -0400
Message-ID: <5571251A.5090907@dunslane.net> (raw)
In-Reply-To: <CAA4eK1+fLqQYWKNM+arNC0QryGGQkUJ0VHUOhoLZjTRB6xJfCQ@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>
	<556DE03B.1020809@dunslane.net>
	<CAA4eK1LQKmUo7Ng0oC--iFMm38x1=+_rzYw-o=UGDYNm8BC4Dw@mail.gmail.com>
	<556F620E.2010403@dunslane.net>
	<CAA4eK1K+n7GH0SB-QVJiEV40+=g6ccNHzzEJE852pb5yd0wfKw@mail.gmail.com>
	<CAA4eK1LC1fnMAMij=A1V_eV7inAiuSwqtg8CGy6y2QDc3ZpJmg@mail.gmail.com>
	<5571028A.1070706@dunslane.net>
	<CAA4eK1+fLqQYWKNM+arNC0QryGGQkUJ0VHUOhoLZjTRB6xJfCQ@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>


On 06/04/2015 11:35 PM, Amit Kapila wrote:
> On Fri, Jun 5, 2015 at 7:29 AM, Andrew Dunstan <andrew@dunslane.net 
> <mailto:andrew@dunslane.net>> wrote:
>
>
>     On 06/04/2015 09:23 AM, Amit Kapila wrote:
>
>
>
>
>             Okay, as we both seem to agree that it can be mostly used in
>             tablespace symlinks context, so I have changed the name to
>             remove_tablespace_symlink() and moved the function to
>             tablespace.c.  S_ISLINK check is used for non-windows code,
>             so not sure adding it here makes any real difference now that
>             we have made it specific to tablespace and we might need to
>             write small port specific code if we want to add S_ISLINK
>         check.
>
>
>
>     Where is it used? I can't see it called at all in tablespace.c or
>     xlog.c.
>
>
> Below files use S_ISLINK check
> basebackup.c, fd.c, initdb.c, copy_fetch.c, pg_rewind/filemap.c
>
> and all these places use it with #ifndef WIN32
>
>     Perhaps I'm being overcautious, but here's more or less what I had
>     in mind.
>
>
> What is making you feel nervous, if it is that we should not
> use unlink call without checking S_ISLINK, then we are
> already doing the same at many other places (rewriteheap.c,
> slru.c, timeline.c, xlog.c).  It is already defined for Windows
> as pgunlink.
>
> Theoretically, I don't see much problem by changing the checks
> way you have done in patch, but it becomes different than what
> we have in destroy_tablespace_directories() and it is slightly
> changing the way check was originally done in
> create_tablespace_directories(), basically original check will try
> unlink if lstat returns non-zero return code. If you want to proceed
> with the changed checks as in v3, then may be we can modify
> comments on top of function remove_tablespace_symlink() which
> indicates that it works like destroy_tablespace_directories().
>


The difference is that here we're getting the list from a base backup 
and it seems to me the risk of having a file we don't really want to 
unlink is significantly greater.

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: <5571251A.5090907@dunslane.net>
Permalink:  ../5571251A.5090907@dunslane.net/
Also on:    postgresql.org/message-id/5571251A.5090907@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: <5571251A.5090907@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> <556DE03B.1020809@dunslane.net> <CAA4eK1LQKmUo7Ng0oC--iFMm38x1=+_rzYw-o=UGDYNm8BC4Dw@mail.gmail.com> <556F620E.2010403@dunslane.net> <CAA4eK1K+n7GH0SB-QVJiEV40+=g6ccNHzzEJE852pb5yd0wfKw@mail.gmail.com> <CAA4eK1LC1fnMAMij=A1V_eV7inAiuSwqtg8CGy6y2QDc3ZpJmg@mail.gmail.com> <5571028A.1070706@dunslane.net> <CAA4eK1+fLqQYWKNM+arNC0QryGGQkUJ0VHUOhoLZjTRB6xJfCQ@mail.gmail.com> <5571251A.5090907@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