Re: New option for pg_basebackup, to specify a different directory for pg_xlog - Mailing list pgsql-hackers

From Haribabu kommi
Subject Re: New option for pg_basebackup, to specify a different directory for pg_xlog
Date
Msg-id 8977CB36860C5843884E0A18D8747B0372BF081C@szxeml558-mbs.china.huawei.com
Whole thread Raw
In response to Re: New option for pg_basebackup, to specify a different directory for pg_xlog  (Fujii Masao <masao.fujii@gmail.com>)
List pgsql-hackers
On 27 November 2013 10:35 Fujii Masao wrote:
> On Wed, Nov 27, 2013 at 1:27 PM, Haribabu kommi
> <haribabu.kommi@huawei.com> wrote:
> > On 26 November 2013 23:11 Fujii Masao wrote:
> >> On Wed, Nov 20, 2013 at 7:43 PM, Haribabu kommi
> >> <haribabu.kommi@huawei.com> wrote:
> >> > I tried using of stat'ing in two directories, which is having a
> >> problem in windows.
> >> > So modified old approach to detect limited errors. Updated patch
> >> attached.
> >> > This will detect and throw an error in the following scenarios.
> >> > 1. pg_basebackup -D /home/data --xlogdir=/home/data 2.
> >> > pg_basebackup -D data --xlogdir=/home/data -- home is the CWD 3.
> >> > pg_basebackup -D ../data --xlogdir=/data -- home is the CWD
> >> >
> >> > Please let me know your suggestions.
> >>
> >> Checking only #1 and #2 cases looks sufficient to at least me. If we
> >> do that, we can refactor the patch so that it reuses
> >> make_absolute_path() instead of adding new functions, as pointed in
> >> upthread. Anyway, what about committing the core patch (Updated
> >> version of core patch attached) first? Then, we can discuss the
> check logic more.
> >
> > Yes it is fine. The core patch attached in the mail is working fine.
>
> Okay. Committed!

Thanks. Regarding refactoring the code to use make_absolute_path for checking
the data and xlog directories are same or not, this function exists in two places
1. pg_regress.c 2.miscinit.c.

Solution -1: if we move the backend function to path.c, it cannot use the ereport
Functions. So it may cause problem to backends.

Solution -2: Rename the backend function as make_absolute_path_internal and add a
New function to the path.c

Please let me know your opinion on the same or is there anything I missed?

Regards,
Hari babu.



pgsql-hackers by date:

Previous
From: "Etsuro Fujita"
Date:
Subject: Re: Get more from indices.
Next
From: Sawada Masahiko
Date:
Subject: Re: Logging WAL when updating hintbit