Re: Re: [COMMITTERS] pgsql: Map basebackup tablespaces using a tablespace_map file - Mailing list pgsql-hackers

From Amit Kapila
Subject Re: Re: [COMMITTERS] pgsql: Map basebackup tablespaces using a tablespace_map file
Date
Msg-id CAA4eK1+KD3g3WLQUgEfqY+ApxQ=_0ygXt=SR91Tp72KEbqH1Aw@mail.gmail.com
Whole thread Raw
In response to Re: Re: [COMMITTERS] pgsql: Map basebackup tablespaces using a tablespace_map file  (Fujii Masao <masao.fujii@gmail.com>)
Responses Re: Re: [COMMITTERS] pgsql: Map basebackup tablespaces using a tablespace_map file  (Fujii Masao <masao.fujii@gmail.com>)
List pgsql-hackers
On Thu, Sep 3, 2015 at 6:07 PM, Fujii Masao <masao.fujii@gmail.com> wrote:
>
> On Tue, Aug 4, 2015 at 12:15 PM, Amit Kapila <amit.kapila16@gmail.com> wrote:
> > On Mon, Aug 3, 2015 at 7:44 PM, Fujii Masao <masao.fujii@gmail.com> wrote:
> >> ISTM that we can
> >> see that the online backup mode has already been canceled if backup_label
> >> file
> >> is successfully removed whether tablespace_map file remains or not. No?
> >>
> >
> > I think what we should do is that display successful cancellation message
> > only when both the files are renamed.
>
> Please imagine the case where backup_label was successfully renamed
> but tablespace_map was not. Even in this case, I think that we can see
> that the backup mode was canceled because the remaining tablespace_map
> file will be ignored in the subsequent recovery.

Right.
 
>
> So we should emit
> the successful cancellation message when backup_label is renamed
> whether tablespace_map is successfully renamed or not?
>

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 way, which is even after the
backup is cancelled, on next recovery, there will be a log message indicating
either rename of tablespace_map successful or unsuccessful.  Also, don't you
think it is better to let user know that the tablespace_map file is successfully
renamed as we do for backup_label file.  Shall we change the patch such that
if backup_label is successfully renamed and renaming of tablespace_map
gets failed, then display a log message to something like below:

LOG:  online backup mode canceled
DETAIL:  "backup_label" was renamed to "backup_label.old", could not rename
"tablespace_map" to "tablespace_map.old"


With Regards,
Amit Kapila.

pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: [PATCH] SQL function to report log message
Next
From: Pavel Stehule
Date:
Subject: Re: [PATCH] SQL function to report log message