Re: [HACKERS] Re: [COMMITTERS] pgsql: Map basebackup tablespaces using a tablespace_map file

2015-09-15 Thread Fujii Masao
On Fri, Sep 11, 2015 at 1:57 PM, Amit Kapila wrote: > On Fri, Sep 11, 2015 at 10:10 AM, Fujii Masao wrote: >> >> So I added the object type, i.e., file in this case, to the errdetail >> messages. Attached is the updated version of the patch. >> >> I also changed other log messages related to tabl

Re: [HACKERS] Re: [COMMITTERS] pgsql: Map basebackup tablespaces using a tablespace_map file

2015-09-10 Thread Amit Kapila
On Fri, Sep 11, 2015 at 10:10 AM, Fujii Masao wrote: > > So I added the object type, i.e., file in this case, to the errdetail > messages. Attached is the updated version of the patch. > > I also changed other log messages related to tablespace_map > so that they follow the style guide. > Looks g

Re: [HACKERS] Re: [COMMITTERS] pgsql: Map basebackup tablespaces using a tablespace_map file

2015-09-10 Thread Fujii Masao
On Fri, Sep 11, 2015 at 5:43 AM, Robert Haas wrote: > On Thu, Sep 10, 2015 at 3:52 PM, Tom Lane wrote: >> Robert Haas writes: >>> On Wed, Sep 9, 2015 at 11:49 PM, Amit Kapila >>> wrote: - errdetail("Could not rename \"%s\" to \"%s\": %m.", + errdetail("\"%s\" could not be renamed to

Re: [HACKERS] Re: [COMMITTERS] pgsql: Map basebackup tablespaces using a tablespace_map file

2015-09-10 Thread Robert Haas
On Thu, Sep 10, 2015 at 3:52 PM, Tom Lane wrote: > Robert Haas writes: >> On Wed, Sep 9, 2015 at 11:49 PM, Amit Kapila wrote: >>> - errdetail("Could not rename \"%s\" to \"%s\": %m.", >>> + errdetail("\"%s\" could not be renamed to \"%s\": %m.", >>> >>> Is there any reason to change this message

Re: [HACKERS] Re: [COMMITTERS] pgsql: Map basebackup tablespaces using a tablespace_map file

2015-09-10 Thread Tom Lane
Robert Haas writes: > On Wed, Sep 9, 2015 at 11:49 PM, Amit Kapila wrote: >> - errdetail("Could not rename \"%s\" to \"%s\": %m.", >> + errdetail("\"%s\" could not be renamed to \"%s\": %m.", >> >> Is there any reason to change this message? >> I think you have changed this message to make it so

Re: [HACKERS] Re: [COMMITTERS] pgsql: Map basebackup tablespaces using a tablespace_map file

2015-09-10 Thread Robert Haas
On Wed, Sep 9, 2015 at 11:49 PM, Amit Kapila wrote: > - errdetail("Could not rename \"%s\" to \"%s\": %m.", > + errdetail("\"%s\" could not be renamed to \"%s\": %m.", > > Is there any reason to change this message? > I think you have changed this message to make it somewhat similar with > the new

Re: [HACKERS] Re: [COMMITTERS] pgsql: Map basebackup tablespaces using a tablespace_map file

2015-09-09 Thread Fujii Masao
On Thu, Sep 10, 2015 at 1:08 PM, Amit Kapila wrote: > On Thu, Sep 10, 2015 at 9:29 AM, Fujii Masao wrote: >> >> On Thu, Sep 10, 2015 at 12:49 PM, Amit Kapila >> wrote: >> > On Wed, Sep 9, 2015 at 6:43 PM, Fujii Masao >> > wrote: >> >> >> >> On Fri, Sep 4, 2015 at 4:48 PM, Amit Kapila >> >> wro

Re: [HACKERS] Re: [COMMITTERS] pgsql: Map basebackup tablespaces using a tablespace_map file

2015-09-09 Thread Amit Kapila
On Thu, Sep 10, 2015 at 9:29 AM, Fujii Masao wrote: > > On Thu, Sep 10, 2015 at 12:49 PM, Amit Kapila wrote: > > On Wed, Sep 9, 2015 at 6:43 PM, Fujii Masao wrote: > >> > >> On Fri, Sep 4, 2015 at 4:48 PM, Amit Kapila > >> wrote: > >> > > > > - errdetail("Could not rename \"%s\" to \"%s\": %m."

Re: [HACKERS] Re: [COMMITTERS] pgsql: Map basebackup tablespaces using a tablespace_map file

2015-09-09 Thread Fujii Masao
On Thu, Sep 10, 2015 at 12:49 PM, Amit Kapila wrote: > On Wed, Sep 9, 2015 at 6:43 PM, Fujii Masao wrote: >> >> On Fri, Sep 4, 2015 at 4:48 PM, Amit Kapila >> wrote: >> > >> > You mean to say, just try renaming tablespace_map and don't display any >> > message whether that is successful or not-s

Re: [HACKERS] Re: [COMMITTERS] pgsql: Map basebackup tablespaces using a tablespace_map file

2015-09-09 Thread Amit Kapila
On Wed, Sep 9, 2015 at 6:43 PM, Fujii Masao wrote: > > On Fri, Sep 4, 2015 at 4:48 PM, Amit Kapila wrote: > > > > You mean to say, just try renaming tablespace_map and don't display any > > message whether that is successful or not-successful? > > > > I see some user inconvenience if we do this w

Re: [HACKERS] Re: [COMMITTERS] pgsql: Map basebackup tablespaces using a tablespace_map file

2015-09-09 Thread Fujii Masao
On Fri, Sep 4, 2015 at 4:48 PM, Amit Kapila wrote: > On Thu, Sep 3, 2015 at 6:07 PM, Fujii Masao wrote: >> >> On Tue, Aug 4, 2015 at 12:15 PM, Amit Kapila >> wrote: >> > On Mon, Aug 3, 2015 at 7:44 PM, Fujii Masao >> > wrote: >> >> ISTM that we can >> >> see that the online backup mode has alre

Re: [HACKERS] Re: [COMMITTERS] pgsql: Map basebackup tablespaces using a tablespace_map file

2015-09-04 Thread Amit Kapila
On Thu, Sep 3, 2015 at 6:07 PM, Fujii Masao wrote: > > On Tue, Aug 4, 2015 at 12:15 PM, Amit Kapila wrote: > > On Mon, Aug 3, 2015 at 7:44 PM, Fujii Masao wrote: > >> ISTM that we can > >> see that the online backup mode has already been canceled if backup_label > >> file > >> is successfully re

Re: [HACKERS] Re: [COMMITTERS] pgsql: Map basebackup tablespaces using a tablespace_map file

2015-09-03 Thread Fujii Masao
On Sat, Aug 8, 2015 at 1:14 PM, Amit Kapila wrote: > On Tue, Aug 4, 2015 at 8:45 AM, Amit Kapila wrote: >> >> On Mon, Aug 3, 2015 at 7:44 PM, Fujii Masao wrote: >> >> > BTW, while reading the code related to tablespace_map, I found that >> > CancelBackup() emits the WARNING message "online backu

Re: [HACKERS] Re: [COMMITTERS] pgsql: Map basebackup tablespaces using a tablespace_map file

2015-09-03 Thread Fujii Masao
On Tue, Aug 4, 2015 at 12:15 PM, Amit Kapila wrote: > On Mon, Aug 3, 2015 at 7:44 PM, Fujii Masao wrote: >> >> >> Thanks! Pushed. >> > > Thanks to you as well for committing the patch. > >> BTW, while reading the code related to tablespace_map, I found that >> CancelBackup() emits the WARNING mes

Re: [HACKERS] Re: [COMMITTERS] pgsql: Map basebackup tablespaces using a tablespace_map file

2015-08-07 Thread Amit Kapila
On Tue, Aug 4, 2015 at 8:45 AM, Amit Kapila wrote: > > On Mon, Aug 3, 2015 at 7:44 PM, Fujii Masao wrote: > > > BTW, while reading the code related to tablespace_map, I found that > > CancelBackup() emits the WARNING message "online backup mode was not canceled" > > when rename() fails. Isn't thi

Re: [HACKERS] Re: [COMMITTERS] pgsql: Map basebackup tablespaces using a tablespace_map file

2015-08-03 Thread Amit Kapila
On Mon, Aug 3, 2015 at 7:44 PM, Fujii Masao wrote: > > > Thanks! Pushed. > Thanks to you as well for committing the patch. > BTW, while reading the code related to tablespace_map, I found that > CancelBackup() emits the WARNING message "online backup mode was not canceled" > when rename() fails.

Re: [HACKERS] Re: [COMMITTERS] pgsql: Map basebackup tablespaces using a tablespace_map file

2015-08-03 Thread Fujii Masao
On Mon, Aug 3, 2015 at 8:55 PM, Amit Kapila wrote: > On Thu, Jul 16, 2015 at 9:58 PM, Robert Haas wrote: >> >> On Thu, Jul 16, 2015 at 9:41 AM, Fujii Masao >> wrote: >> > Here are some minor comments: >> > >> > +ereport(LOG, >> > +(errmsg("ignoring \"%s\"

Re: [HACKERS] Re: [COMMITTERS] pgsql: Map basebackup tablespaces using a tablespace_map file

2015-08-03 Thread Amit Kapila
On Thu, Jul 16, 2015 at 9:58 PM, Robert Haas wrote: > > On Thu, Jul 16, 2015 at 9:41 AM, Fujii Masao wrote: > > Here are some minor comments: > > > > +ereport(LOG, > > +(errmsg("ignoring \"%s\" file because no > > \"%s\" file exists", > > +

Re: [HACKERS] Re: [COMMITTERS] pgsql: Map basebackup tablespaces using a tablespace_map file

2015-07-16 Thread Amit Kapila
On Thu, Jul 16, 2015 at 12:30 PM, Alvaro Herrera wrote: > > Amit Kapila wrote: > > > This can be tracked either in 9.5 Open Items or for next CF, > > any opinions? > > > > If nobody else has any opinion on this, I will add it to 9.5 Open Items > > list. > > I think this belongs in the open items l

Re: [HACKERS] Re: [COMMITTERS] pgsql: Map basebackup tablespaces using a tablespace_map file

2015-07-16 Thread Robert Haas
On Thu, Jul 16, 2015 at 9:54 PM, Fujii Masao wrote: > Isn't this "rule" confusing the administrators? I'd like to think not, but yeah, it probably is. It is not like it isn't documented. There are even comments in postgresql.conf explaining it. But the fact that we have committers who are conf

Re: [HACKERS] Re: [COMMITTERS] pgsql: Map basebackup tablespaces using a tablespace_map file

2015-07-16 Thread Fujii Masao
On Fri, Jul 17, 2015 at 1:28 AM, Robert Haas wrote: > On Thu, Jul 16, 2015 at 9:41 AM, Fujii Masao wrote: >> Here are some minor comments: >> >> +ereport(LOG, >> +(errmsg("ignoring \"%s\" file because no >> \"%s\" file exists", >> +

Re: [HACKERS] Re: [COMMITTERS] pgsql: Map basebackup tablespaces using a tablespace_map file

2015-07-16 Thread Alvaro Herrera
Robert Haas wrote: > On Thu, Jul 16, 2015 at 9:41 AM, Fujii Masao wrote: > > Here are some minor comments: > > > > +ereport(LOG, > > +(errmsg("ignoring \"%s\" file because no > > \"%s\" file exists", > > +TABLESPACE_MAP, BACKU

Re: [HACKERS] Re: [COMMITTERS] pgsql: Map basebackup tablespaces using a tablespace_map file

2015-07-16 Thread Robert Haas
On Thu, Jul 16, 2015 at 9:41 AM, Fujii Masao wrote: > Here are some minor comments: > > +ereport(LOG, > +(errmsg("ignoring \"%s\" file because no > \"%s\" file exists", > +TABLESPACE_MAP, BACKUP_LABEL_FILE), > +

Re: [HACKERS] Re: [COMMITTERS] pgsql: Map basebackup tablespaces using a tablespace_map file

2015-07-16 Thread Fujii Masao
On Fri, Jul 3, 2015 at 12:15 PM, Amit Kapila wrote: > On Thu, Jul 2, 2015 at 7:44 PM, Alvaro Herrera > wrote: >> >> Amit Kapila wrote: >> > >> > Added the above log messages in attached patch with small change >> > such that in message, file names will be displayed with quotes as most >> > of oth

Re: [HACKERS] Re: [COMMITTERS] pgsql: Map basebackup tablespaces using a tablespace_map file

2015-07-16 Thread Alvaro Herrera
Amit Kapila wrote: > This can be tracked either in 9.5 Open Items or for next CF, > any opinions? > > If nobody else has any opinion on this, I will add it to 9.5 Open Items > list. I think this belongs in the open items list, yeah. -- Álvaro Herrerahttp://www.2ndQuadrant.com/

Re: [HACKERS] Re: [COMMITTERS] pgsql: Map basebackup tablespaces using a tablespace_map file

2015-07-15 Thread Amit Kapila
On Fri, Jul 3, 2015 at 8:45 AM, Amit Kapila wrote: > > On Thu, Jul 2, 2015 at 7:44 PM, Alvaro Herrera wrote: > > > > Can we reduce that to a single one? Maybe the > > first one could be errdetail or something. > > > > I think it is better other way (basically have second one as errdetail). > We

Re: [HACKERS] Re: [COMMITTERS] pgsql: Map basebackup tablespaces using a tablespace_map file

2015-07-02 Thread Amit Kapila
On Thu, Jul 2, 2015 at 7:44 PM, Alvaro Herrera wrote: > > Amit Kapila wrote: > > > > Added the above log messages in attached patch with small change > > such that in message, file names will be displayed with quotes as most > > of other usages of rename (failure) in that file uses quotes to displ

Re: [HACKERS] Re: [COMMITTERS] pgsql: Map basebackup tablespaces using a tablespace_map file

2015-07-02 Thread Alvaro Herrera
Amit Kapila wrote: > On Sat, Jun 27, 2015 at 12:54 AM, Robert Haas wrote: > > > > On Mon, Jun 15, 2015 at 2:52 PM, Amit Kapila > > wrote: > > > Attached patch provides a fix as per above discussion. > > > > I think we should emit some LOG messages here. When we detect the > > file is there: > >

Re: [HACKERS] Re: [COMMITTERS] pgsql: Map basebackup tablespaces using a tablespace_map file

2015-07-01 Thread Amit Kapila
On Sat, Jun 27, 2015 at 12:54 AM, Robert Haas wrote: > > On Mon, Jun 15, 2015 at 2:52 PM, Amit Kapila wrote: > > Attached patch provides a fix as per above discussion. > > I think we should emit some LOG messages here. When we detect the > file is there: > > LOG: ignoring tablespace_map file bec

Re: [HACKERS] Re: [COMMITTERS] pgsql: Map basebackup tablespaces using a tablespace_map file

2015-06-26 Thread Amit Kapila
On Sat, Jun 27, 2015 at 1:32 AM, Robert Haas wrote: > > On Wed, Jun 10, 2015 at 3:34 AM, Amit Kapila wrote: > > Okay, I have updated the patch to destroy_tablespace_directories() code > > as well in the attached patch. I have tried to modify > > remove_tablespace_symlink(), so that it can be call

Re: [HACKERS] Re: [COMMITTERS] pgsql: Map basebackup tablespaces using a tablespace_map file

2015-06-26 Thread Robert Haas
On Wed, Jun 10, 2015 at 3:34 AM, Amit Kapila wrote: > Okay, I have updated the patch to destroy_tablespace_directories() code > as well in the attached patch. I have tried to modify > remove_tablespace_symlink(), so that it can be called from > destroy_tablespace_directories(), but that is making

Re: [HACKERS] Re: [COMMITTERS] pgsql: Map basebackup tablespaces using a tablespace_map file

2015-06-26 Thread Robert Haas
On Mon, Jun 15, 2015 at 2:52 PM, Amit Kapila wrote: > Attached patch provides a fix as per above discussion. I think we should emit some LOG messages here. When we detect the file is there: LOG: ignoring tablespace_map file because no backup_label file exists If the rename fails: LOG: could n

Re: [HACKERS] Re: [COMMITTERS] pgsql: Map basebackup tablespaces using a tablespace_map file

2015-06-15 Thread Amit Kapila
On Thu, Jun 11, 2015 at 9:55 AM, Amit Kapila wrote: > > On Wed, Jun 10, 2015 at 12:09 PM, Fujii Masao wrote: > > > > On Tue, Jun 9, 2015 at 3:29 PM, Amit Kapila wrote: > > > On Tue, Jun 9, 2015 at 10:56 AM, Fujii Masao wrote: > > >> Or what about removing tablespace_map file at the beginning of

Re: [HACKERS] Re: [COMMITTERS] pgsql: Map basebackup tablespaces using a tablespace_map file

2015-06-10 Thread Amit Kapila
On Wed, Jun 10, 2015 at 12:09 PM, Fujii Masao wrote: > > On Tue, Jun 9, 2015 at 3:29 PM, Amit Kapila wrote: > > On Tue, Jun 9, 2015 at 10:56 AM, Fujii Masao wrote: > >> Or what about removing tablespace_map file at the beginning of recovery > >> whenever backup_label doesn't exist? > > > > Yes,

Re: [HACKERS] Re: [COMMITTERS] pgsql: Map basebackup tablespaces using a tablespace_map file

2015-06-10 Thread Amit Kapila
On Tue, Jun 9, 2015 at 8:37 PM, Andrew Dunstan wrote: > > On 06/08/2015 11:19 PM, Amit Kapila wrote: > >> >> 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 de

Re: [HACKERS] Re: [COMMITTERS] pgsql: Map basebackup tablespaces using a tablespace_map file

2015-06-09 Thread Fujii Masao
On Tue, Jun 9, 2015 at 3:29 PM, Amit Kapila wrote: > On Tue, Jun 9, 2015 at 10:56 AM, Fujii Masao wrote: >> >> On Tue, Jun 9, 2015 at 1:04 PM, Amit Kapila >> wrote: >> > On Tue, Jun 9, 2015 at 9:09 AM, Fujii Masao >> > wrote: >> >> >> >> On Tue, May 12, 2015 at 10:42 PM, Andrew Dunstan >> >> w

Re: [HACKERS] Re: [COMMITTERS] pgsql: Map basebackup tablespaces using a tablespace_map file

2015-06-09 Thread Andrew Dunstan
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

Re: [HACKERS] Re: [COMMITTERS] pgsql: Map basebackup tablespaces using a tablespace_map file

2015-06-08 Thread Amit Kapila
On Tue, Jun 9, 2015 at 10:56 AM, Fujii Masao wrote: > > On Tue, Jun 9, 2015 at 1:04 PM, Amit Kapila wrote: > > On Tue, Jun 9, 2015 at 9:09 AM, Fujii Masao wrote: > >> > >> On Tue, May 12, 2015 at 10:42 PM, Andrew Dunstan > >> wrote: > >> > Map basebackup tablespaces using a tablespace_map file

Re: [HACKERS] Re: [COMMITTERS] pgsql: Map basebackup tablespaces using a tablespace_map file

2015-06-08 Thread Fujii Masao
On Tue, Jun 9, 2015 at 1:04 PM, Amit Kapila wrote: > On Tue, Jun 9, 2015 at 9:09 AM, Fujii Masao wrote: >> >> On Tue, May 12, 2015 at 10:42 PM, Andrew Dunstan >> wrote: >> > Map basebackup tablespaces using a tablespace_map file >> > >> > Windows can't reliably restore symbolic links from a tar

Re: [HACKERS] Re: [COMMITTERS] pgsql: Map basebackup tablespaces using a tablespace_map file

2015-06-08 Thread Amit Kapila
On Tue, Jun 9, 2015 at 9:09 AM, Fujii Masao wrote: > > On Tue, May 12, 2015 at 10:42 PM, Andrew Dunstan wrote: > > Map basebackup tablespaces using a tablespace_map file > > > > Windows can't reliably restore symbolic links from a tar format, so > > instead during backup start we create a tablesp

[HACKERS] Re: [COMMITTERS] pgsql: Map basebackup tablespaces using a tablespace_map file

2015-06-08 Thread Fujii Masao
On Tue, May 12, 2015 at 10:42 PM, Andrew Dunstan wrote: > Map basebackup tablespaces using a tablespace_map file > > Windows can't reliably restore symbolic links from a tar format, so > instead during backup start we create a tablespace_map file, which is > used by the restoring postgres to creat

Re: [HACKERS] Re: [COMMITTERS] pgsql: Map basebackup tablespaces using a tablespace_map file

2015-06-08 Thread Amit Kapila
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

Re: [HACKERS] Re: [COMMITTERS] pgsql: Map basebackup tablespaces using a tablespace_map file

2015-06-08 Thread Andrew Dunstan
On 06/08/2015 11:16 AM, Amit Kapila wrote: On Mon, Jun 8, 2015 at 6:39 PM, Andrew Dunstan > 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 erro

Re: [HACKERS] Re: [COMMITTERS] pgsql: Map basebackup tablespaces using a tablespace_map file

2015-06-08 Thread Alvaro Herrera
Robert Haas wrote: > Why not? I think that if we encounter some sort of situation that we > think should never happen, throwing an error is exactly what we > *should* do. Particularly when it comes to things like removing > files, it is very dangerous for the database to proceed if the > situati

Re: [HACKERS] Re: [COMMITTERS] pgsql: Map basebackup tablespaces using a tablespace_map file

2015-06-08 Thread Robert Haas
On Mon, Jun 8, 2015 at 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 n

Re: [HACKERS] Re: [COMMITTERS] pgsql: Map basebackup tablespaces using a tablespace_map file

2015-06-08 Thread Amit Kapila
On Mon, Jun 8, 2015 at 6:39 PM, Andrew Dunstan 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 w

Re: [HACKERS] Re: [COMMITTERS] pgsql: Map basebackup tablespaces using a tablespace_map file

2015-06-08 Thread Andrew Dunstan
On 06/08/2015 12:08 AM, Amit Kapila wrote: On Mon, Jun 8, 2015 at 5:52 AM, Andrew Dunstan > 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,

Re: [HACKERS] Re: [COMMITTERS] pgsql: Map basebackup tablespaces using a tablespace_map file

2015-06-07 Thread Amit Kapila
On Mon, Jun 8, 2015 at 5:52 AM, Andrew Dunstan 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

Re: [HACKERS] Re: [COMMITTERS] pgsql: Map basebackup tablespaces using a tablespace_map file

2015-06-07 Thread Andrew Dunstan
On 06/05/2015 11:08 PM, Amit Kapila wrote: On Fri, Jun 5, 2015 at 10:51 AM, Amit Kapila > wrote: On Fri, Jun 5, 2015 at 9:57 AM, Andrew Dunstan mailto:and...@dunslane.net>> wrote: On 06/04/2015 11:35 PM, Amit Kapila wrote: Theoreti

Re: [HACKERS] Re: [COMMITTERS] pgsql: Map basebackup tablespaces using a tablespace_map file

2015-06-05 Thread Amit Kapila
On Fri, Jun 5, 2015 at 10:51 AM, Amit Kapila wrote: > On Fri, Jun 5, 2015 at 9:57 AM, Andrew Dunstan > wrote: > >> >> On 06/04/2015 11:35 PM, Amit Kapila wrote: >> >>> >>> Theoretically, I don't see much problem by changing the checks >>> way you have done in patch, but it becomes different than

Re: [HACKERS] Re: [COMMITTERS] pgsql: Map basebackup tablespaces using a tablespace_map file

2015-06-04 Thread Amit Kapila
On Fri, Jun 5, 2015 at 9:57 AM, Andrew Dunstan wrote: > > On 06/04/2015 11:35 PM, Amit Kapila wrote: > >> >> 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 sl

Re: [HACKERS] Re: [COMMITTERS] pgsql: Map basebackup tablespaces using a tablespace_map file

2015-06-04 Thread Andrew Dunstan
On 06/04/2015 11:35 PM, Amit Kapila wrote: On Fri, Jun 5, 2015 at 7:29 AM, Andrew Dunstan > 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

Re: [HACKERS] Re: [COMMITTERS] pgsql: Map basebackup tablespaces using a tablespace_map file

2015-06-04 Thread Amit Kapila
On Fri, Jun 5, 2015 at 7:29 AM, Andrew Dunstan 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 fu

Re: [HACKERS] Re: [COMMITTERS] pgsql: Map basebackup tablespaces using a tablespace_map file

2015-06-04 Thread Andrew Dunstan
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,

Re: [HACKERS] Re: [COMMITTERS] pgsql: Map basebackup tablespaces using a tablespace_map file

2015-06-04 Thread Amit Kapila
On Thu, Jun 4, 2015 at 8:43 PM, Andrew Dunstan wrote: > > On 06/04/2015 12:44 AM, Amit Kapila wrote: > >> >> Given that the function raises an error on failure, I think it >> will otherwise be OK as is. >> >> >> Please find an updated patch attached with this mail. >> >> >> > > No attachm

Re: [HACKERS] Re: [COMMITTERS] pgsql: Map basebackup tablespaces using a tablespace_map file

2015-06-04 Thread Andrew Dunstan
On 06/04/2015 12:44 AM, Amit Kapila wrote: Given that the function raises an error on failure, I think it will otherwise be OK as is. Please find an updated patch attached with this mail. No attachment. cheers andrew -- Sent via pgsql-hackers mailing list (pgsql-hackers@postg

Re: [HACKERS] Re: [COMMITTERS] pgsql: Map basebackup tablespaces using a tablespace_map file

2015-06-04 Thread Amit Kapila
On Thu, Jun 4, 2015 at 10:14 AM, Amit Kapila wrote: > On Thu, Jun 4, 2015 at 1:52 AM, Andrew Dunstan > wrote: > >> >> On 06/02/2015 11:55 PM, Amit Kapila wrote: >> >> On Tue, Jun 2, 2015 at 10:26 PM, Andrew Dunstan >> > wrote: >>> >>> Well, it seems to me the new

Re: [HACKERS] Re: [COMMITTERS] pgsql: Map basebackup tablespaces using a tablespace_map file

2015-06-03 Thread Amit Kapila
On Thu, Jun 4, 2015 at 1:52 AM, Andrew Dunstan wrote: > > On 06/02/2015 11:55 PM, Amit Kapila wrote: > > On Tue, Jun 2, 2015 at 10:26 PM, Andrew Dunstan > > wrote: >> >> Well, it seems to me the new function is being altogether way too >> trusting about the na

Re: [HACKERS] Re: [COMMITTERS] pgsql: Map basebackup tablespaces using a tablespace_map file

2015-06-03 Thread Andrew Dunstan
On 06/02/2015 11:55 PM, Amit Kapila wrote: On Tue, Jun 2, 2015 at 10:26 PM, Andrew Dunstan > wrote: On 05/15/2015 02:21 AM, Amit Kapila wrote: Find the patch which gets rid of rmtree usage. I have made it as a separate function because the sam

Re: [HACKERS] Re: [COMMITTERS] pgsql: Map basebackup tablespaces using a tablespace_map file

2015-06-02 Thread Amit Kapila
On Tue, Jun 2, 2015 at 10:26 PM, Andrew Dunstan wrote: > > On 05/15/2015 02:21 AM, Amit Kapila wrote: >> >> >> Find the patch which gets rid of rmtree usage. I have made it as >> a separate function because the same code is used from >> create_tablespace_directories() as well. I thought of exte

Re: [HACKERS] Re: [COMMITTERS] pgsql: Map basebackup tablespaces using a tablespace_map file

2015-06-02 Thread Andrew Dunstan
On 05/15/2015 02:21 AM, Amit Kapila wrote: On Thu, May 14, 2015 at 10:29 PM, Andrew Dunstan > wrote: > > > On 05/14/2015 10:52 AM, Robert Haas wrote: >> >> On Thu, May 14, 2015 at 12:12 AM, Amit Kapila mailto:amit.kapil...@gmail.com>> wrote: >>> >>> On Thu, May 14,

Re: [HACKERS] Re: [COMMITTERS] pgsql: Map basebackup tablespaces using a tablespace_map file

2015-05-23 Thread Amit Kapila
On Sat, May 23, 2015 at 9:28 PM, Andrew Dunstan wrote: > > > On 05/23/2015 01:29 AM, Amit Kapila wrote: >> > Find the patch which gets rid of rmtree usage. I have made it as >> > a separate function because the same code is used from >> > create_tablespace_directories() as well. I thought of ext

Re: [HACKERS] Re: [COMMITTERS] pgsql: Map basebackup tablespaces using a tablespace_map file

2015-05-23 Thread Andrew Dunstan
On 05/23/2015 01:29 AM, Amit Kapila wrote: On Fri, May 15, 2015 at 11:51 AM, Amit Kapila > wrote: > > On Thu, May 14, 2015 at 10:29 PM, Andrew Dunstan mailto:and...@dunslane.net>> wrote: > > > > > > On 05/14/2015 10:52 AM, Robert Haas wrote: > >> > >> On Thu, Ma

Re: [HACKERS] Re: [COMMITTERS] pgsql: Map basebackup tablespaces using a tablespace_map file

2015-05-22 Thread Amit Kapila
On Fri, May 15, 2015 at 11:51 AM, Amit Kapila wrote: > > On Thu, May 14, 2015 at 10:29 PM, Andrew Dunstan wrote: > > > > > > On 05/14/2015 10:52 AM, Robert Haas wrote: > >> > >> On Thu, May 14, 2015 at 12:12 AM, Amit Kapila wrote: > >>> > >>> On Thu, May 14, 2015 at 2:10 AM, Andrew Dunstan wrot

Re: [HACKERS] Re: [COMMITTERS] pgsql: Map basebackup tablespaces using a tablespace_map file

2015-05-14 Thread Amit Kapila
On Thu, May 14, 2015 at 10:29 PM, Andrew Dunstan wrote: > > > On 05/14/2015 10:52 AM, Robert Haas wrote: >> >> On Thu, May 14, 2015 at 12:12 AM, Amit Kapila wrote: >>> >>> On Thu, May 14, 2015 at 2:10 AM, Andrew Dunstan wrote: How about if we simply abort if we find a non-symlink where

Re: [HACKERS] Re: [COMMITTERS] pgsql: Map basebackup tablespaces using a tablespace_map file

2015-05-14 Thread Robert Haas
On Thu, May 14, 2015 at 12:59 PM, Andrew Dunstan wrote: >> I'm not sure I understand this issue in detail, but why would using >> rmtree() on something you expect to be a symlink ever be a good idea? >> It seems like if things are the way you expect them to be, it has no >> benefit, but if they ar

Re: [HACKERS] Re: [COMMITTERS] pgsql: Map basebackup tablespaces using a tablespace_map file

2015-05-14 Thread Andrew Dunstan
On 05/14/2015 10:52 AM, Robert Haas wrote: On Thu, May 14, 2015 at 12:12 AM, Amit Kapila wrote: On Thu, May 14, 2015 at 2:10 AM, Andrew Dunstan wrote: How about if we simply abort if we find a non-symlink where we want the symlink to be, and only remove something that is actually a symlink (

Re: [HACKERS] Re: [COMMITTERS] pgsql: Map basebackup tablespaces using a tablespace_map file

2015-05-14 Thread Robert Haas
On Thu, May 14, 2015 at 12:12 AM, Amit Kapila wrote: > On Thu, May 14, 2015 at 2:10 AM, Andrew Dunstan wrote: >> How about if we simply abort if we find a non-symlink where we want the >> symlink to be, and only remove something that is actually a symlink (or a >> junction point, which is more or

[HACKERS] Re: [COMMITTERS] pgsql: Map basebackup tablespaces using a tablespace_map file

2015-05-13 Thread Amit Kapila
On Thu, May 14, 2015 at 2:10 AM, Andrew Dunstan wrote: > > How about if we simply abort if we find a non-symlink where we want the symlink to be, and only remove something that is actually a symlink (or a junction point, which is more or less the same thing)? > We can do that way and for that I t

[HACKERS] Re: [COMMITTERS] pgsql: Map basebackup tablespaces using a tablespace_map file

2015-05-13 Thread Andrew Dunstan
[redirecting to -hackers] On 05/12/2015 01:30 PM, Amit Kapila wrote: On Tue, May 12, 2015 at 9:02 PM, Andrew Dunstan > wrote: On 05/12/2015 10:33 AM, Heikki Linnakangas wrote: On 05/12/2015 04:42 PM, Andrew Dunstan wrote: + +