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 14:57:12 -0400
Message-ID: <5575E588.9090905@dunslane.net> (raw)
In-Reply-To: <CAA4eK1Kjrbm=P5vQCmeGHbn39x+0T0yOcjYq77NJADBFU-2UuQ@mail.gmail.com>
References: <E1YsASW-0000Aa-Ut@gemulon.postgresql.org>
	<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>
	<CAA4eK1Kjrbm=P5vQCmeGHbn39x+0T0yOcjYq77NJADBFU-2UuQ@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>


On 06/08/2015 11:16 AM, Amit Kapila wrote:
> On Mon, Jun 8, 2015 at 6:39 PM, Andrew Dunstan <andrew@dunslane.net 
> <mailto:andrew@dunslane.net>> wrote:
>
>
>     On 06/08/2015 12:08 AM, Amit Kapila wrote:
>
>         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 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.

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? Closing our eyes and wishing it weren't so 
doesn't seem like a solution.

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