Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Z2L7l-00066W-1G for pgsql-hackers@arkaria.postgresql.org; Tue, 09 Jun 2015 15:07:33 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Z2L7k-0000It-Ez for pgsql-hackers@arkaria.postgresql.org; Tue, 09 Jun 2015 15:07:32 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Z2L7j-0000Im-Gk for pgsql-hackers@postgresql.org; Tue, 09 Jun 2015 15:07:31 +0000 Received: from relay3-d.mail.gandi.net ([2001:4b98:c:538::195]) by makus.postgresql.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1Z2L7g-0005Iz-55 for pgsql-hackers@postgresql.org; Tue, 09 Jun 2015 15:07:30 +0000 Received: from mfilter25-d.gandi.net (mfilter25-d.gandi.net [217.70.178.153]) by relay3-d.mail.gandi.net (Postfix) with ESMTP id 2A718A80CB; Tue, 9 Jun 2015 17:07:24 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mfilter25-d.gandi.net Received: from relay3-d.mail.gandi.net ([217.70.183.195]) by mfilter25-d.gandi.net (mfilter25-d.gandi.net [10.0.15.180]) (amavisd-new, port 10024) with ESMTP id L63PcIJ7QXSc; Tue, 9 Jun 2015 17:07:22 +0200 (CEST) X-Originating-IP: 98.122.164.227 Received: from [192.168.10.146] (unknown [98.122.164.227]) (Authenticated sender: adsend@dunslane.net) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id 8D0A7A80D7; Tue, 9 Jun 2015 17:07:21 +0200 (CEST) Message-ID: <55770128.6060905@dunslane.net> Date: Tue, 09 Jun 2015 11:07:20 -0400 From: Andrew Dunstan User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Amit Kapila CC: Robert Haas , hlinnaka , PostgreSQL-development Subject: Re: Re: [COMMITTERS] pgsql: Map basebackup tablespaces using a tablespace_map file References: <556DE03B.1020809@dunslane.net> <556F620E.2010403@dunslane.net> <5571028A.1070706@dunslane.net> <5571251A.5090907@dunslane.net> <5574E043.8060101@dunslane.net> <55759407.8000801@dunslane.net> <5575E588.9090905@dunslane.net> In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org On 06/08/2015 11:19 PM, Amit Kapila wrote: > On Tue, Jun 9, 2015 at 12:27 AM, Andrew Dunstan > 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