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: Mon, 08 Jun 2015 09:09:27 -0400
Message-ID: <55759407.8000801@dunslane.net> (raw)
In-Reply-To: <CAA4eK1Ko=OM+LxZoJzm+q7gPSsE2JVsLghGpGA0-YQ3-=kgUSw@mail.gmail.com>
References: <E1YsASW-0000Aa-Ut@gemulon.postgresql.org>
	<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>
	<CAA4eK1J5BWSuj=n+49d2RbaxVnmec+eDRkjXSUQgTrQyShyHoA@mail.gmail.com>
	<CAA4eK1KRPRx6-h+tO4G-hTJoD_m_vUsHw_LpOAf2KYjUbT9gvg@mail.gmail.com>
	<5574E043.8060101@dunslane.net>
	<CAA4eK1Ko=OM+LxZoJzm+q7gPSsE2JVsLghGpGA0-YQ3-=kgUSw@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>


On 06/08/2015 12:08 AM, Amit Kapila wrote:
> On Mon, Jun 8, 2015 at 5:52 AM, Andrew Dunstan <andrew@dunslane.net 
> <mailto:andrew@dunslane.net>> wrote:
> >
> > On 06/05/2015 11:08 PM, Amit Kapila wrote:
> >>
> >>
> >>     Okay, I think I can understand why you want to be cautious for
> >>     having a different check for this path, but in that case there is a
> >>     chance that recovery might fail when it will try to create a 
> symlink
> >>     for that file.  Shouldn't we then try to call this new function 
> only
> >>     when we are trying to restore from tablespace_map file and also
> >>     is there a need of ifdef S_ISLINK in remove_tablespace_link?
> >>
> >>
> >> Shall I send an updated patch on these lines or do you want to
> >> proceed with v3 version?
> >>
> >>
> >
> > The point seems to me that we should not be removing anything that's 
> not an empty directory or symlink, and that nothing else has any 
> business being in pg_tblspc. If we encounter such a thing whose name 
> conflicts with the name of a tablespace link we wish to create, rather 
> than quietly blowing it away we should complain loudly, and error out, 
> making it the user's responsibility to clean up their mess. Am I 
> missing something?
> >
>
> How about if it is just a flat file with same name as tablespace link,
> why we want to give error for that case?  I think now it just don't do
> anything with that file (unlink will fail with ENOENT and it will be
> ignored, atleast thats the way currently it behaves in Windows) and
> create a separate symlink with same name which seems okay to
> me and in the change proposed by you it will give error, do you see
> any reason for doing so?
>
>


This is surely wrong. unlink won't fail with ENOENT if the file is 
present; ENOENT means that the file is NOT present. It will succeed if 
the file is present, which is exactly what I'm saying is wrong.

I realize our existing code just more or less assumes that that it's a 
symlink. I think we've probably been a bit careless 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: <55759407.8000801@dunslane.net>
Permalink:  ../55759407.8000801@dunslane.net/
Also on:    postgresql.org/message-id/55759407.8000801@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: <55759407.8000801@dunslane.net>
  References: <E1YsASW-0000Aa-Ut@gemulon.postgresql.org> <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> <CAA4eK1J5BWSuj=n+49d2RbaxVnmec+eDRkjXSUQgTrQyShyHoA@mail.gmail.com> <CAA4eK1KRPRx6-h+tO4G-hTJoD_m_vUsHw_LpOAf2KYjUbT9gvg@mail.gmail.com> <5574E043.8060101@dunslane.net> <CAA4eK1Ko=OM+LxZoJzm+q7gPSsE2JVsLghGpGA0-YQ3-=kgUSw@mail.gmail.com> <55759407.8000801@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