Re: pgsql: Fix pg_rewind when pg_xlog is a symlink. - Mailing list pgsql-committers

From Heikki Linnakangas
Subject Re: pgsql: Fix pg_rewind when pg_xlog is a symlink.
Date
Msg-id 55BF6EB3.2040905@iki.fi
Whole thread Raw
In response to Re: pgsql: Fix pg_rewind when pg_xlog is a symlink.  (Michael Paquier <michael.paquier@gmail.com>)
Responses Re: pgsql: Fix pg_rewind when pg_xlog is a symlink.  (Michael Paquier <michael.paquier@gmail.com>)
List pgsql-committers
On 08/03/2015 03:54 PM, Michael Paquier wrote:
> On Mon, Aug 3, 2015 at 9:34 PM, Heikki Linnakangas
> <heikki.linnakangas@iki.fi> wrote:
>> Fix pg_rewind when pg_xlog is a symlink.
>>
>> pg_xlog is often a symlink, typically to a different filesystem. Don't
>> get confused and comlain about by that, and just always pretend that it's a
>> normal directory, even if it's really a symlink.
>>
>> Also add a test case for this.
>
> +   symlink($master_xlogdir, "$test_master_datadir/pg_xlog") or die;
>
> This will die on Windows, hence I think that this test should be
> skipped in this case.

Sure, I did have this at the top:

+if ($windows_os)
+{
+       plan skip_all => 'symlinks not supported on Windows';
+       exit;
+}
+else
+{
+       plan tests => 4;
+}

That's only on master, though. The TAP tests don't run on Windows in 9.5
anyway.

I guess the pg_rewind tests used to work, but we didn't really advertise
or make it easy to run it, so I'm not sure it's worth it to try to
maintain that. Then again, we might want to backpatch all the TAP-test
changes to make them work on Windows to 9.5, now that they've gotten
some testing in the buildfarm and seem to work.

BTW, I just noticed that the man page for perl's symlink says this:

>  On systems that don't support symbolic links, raises an exception. To check for that, use eval:
>
>     $symlink_exists = eval { symlink("",""); 1 };

I wonder if we should be testing for that, instead of $windows_os.

- Heikki



pgsql-committers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: pgsql: Fix pg_rewind when pg_xlog is a symlink.
Next
From: Fujii Masao
Date:
Subject: pgsql: Make recovery rename tablespace_map to *.old if backup_label is