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: Tue, 09 Jun 2015 11:07:20 -0400
Message-ID: <55770128.6060905@dunslane.net> (raw)
In-Reply-To: <CAA4eK1+H+7Z4Z1cvcrNV3061kUOqbBx_yRS9Kjh=Dx4ZtNHt6g@mail.gmail.com>
References: <E1YsASW-0000Aa-Ut@gemulon.postgresql.org>
	<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>
	<CAA4eK1Kjrbm=P5vQCmeGHbn39x+0T0yOcjYq77NJADBFU-2UuQ@mail.gmail.com>
	<5575E588.9090905@dunslane.net>
	<CAA4eK1+H+7Z4Z1cvcrNV3061kUOqbBx_yRS9Kjh=Dx4ZtNHt6g@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>


On 06/08/2015 11:19 PM, Amit Kapila wrote:
> On Tue, Jun 9, 2015 at 12:27 AM, Andrew Dunstan <andrew@dunslane.net 
> <mailto:andrew@dunslane.net>> wrote:
>
>
>     On 06/08/2015 11:16 AM, Amit Kapila wrote:
>
>
>         I have to retry that operation, but for me unlink hasn't deleted
>         the file on Windows, may be I am not doing properly, but in
>         anycase why we want to throw error for such a case, why
>         can't we just ignore and create a symlink with the same name.
>
>
>     1. You realize that in Windows postgres, unlink is actually
>     pgunlink(), right? See port.h. If your experiments weren't using
>     that then they weren't testing the same thing.
>
>
> Yes, I know that and was using the same version, but the
> small problem in my test was that the file name that is used
> for unlink was not same as that of actual file in directory, sorry
> for the noise.
>
>     2. If the unlink fails and the file is still there (i.e. pretty
>     much everything except the ENOENT case) then creation of the
>     symlink is bound to fail anyway.
>
>           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.
>
>
>         I agree with you that deleting unrelated file with the same
>         name as
>         symlink is not the right thing to do, but not sure throwing
>         error for
>         such a case is better either.
>
>
>
>
>     What else would you suggest? 
>
>
> I think Robert and Alvaro also seems to be inclined towards throwing
> error for such a case, so let us do that way, but one small point is that
> don't you think that similar code in destroy_tablespace_directories() 
> under
> label "remove_symlink:" should use similar logic?


Yes, probably.

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: <55770128.6060905@dunslane.net>
Permalink:  ../55770128.6060905@dunslane.net/
Also on:    postgresql.org/message-id/55770128.6060905@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: <55770128.6060905@dunslane.net>
  References: <E1YsASW-0000Aa-Ut@gemulon.postgresql.org> <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> <CAA4eK1Kjrbm=P5vQCmeGHbn39x+0T0yOcjYq77NJADBFU-2UuQ@mail.gmail.com> <5575E588.9090905@dunslane.net> <CAA4eK1+H+7Z4Z1cvcrNV3061kUOqbBx_yRS9Kjh=Dx4ZtNHt6g@mail.gmail.com> <55770128.6060905@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