Re: pg_basebackup fails on Windows when using tablespace mapping

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: nb <nbedxp(at)gmail(dot)com>
Cc: PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_basebackup fails on Windows when using tablespace mapping
Date: 2017-06-27 03:13:58
Message-ID: CAB7nPqRU7tiF8zXv9c3zrV-1kbtryJFHDRE0_zfUv6ncwG3+-A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Jun 27, 2017 at 1:57 AM, nb <nbedxp(at)gmail(dot)com> wrote:
> Trying to take a `pg_basebackup -T OLDDIR=NEWDIR [etc]` on master (server
> running the cluster) fails on Windows with error "pg_basebackup: directory
> "OLDDIR" exists but is not empty".

Yes, I can see this error easily.

> This fixed the issue, but as a side effect, pg_tablespace_location displays
> path in canonicalized format which might look weird to most Windows users.
>
> There was a suggestion to fix this in client instead, but this fix was the
> simplest one to implement.

At quick glance, I think that this should definitely be a client-only
fix. One reason is that pg_basebackup should be able to work with past
servers. A second is that this impacts as well the backend code, and
readlink may not return an absolute path. At least that's true for
posix's version, Postgres uses its own wrapper with junction points..

> This is my first post to Hackers, so please let me know if I missed
> something or can provide any additional info to help further investigate
> this issue.

Thanks for the report! You are giving enough details to have a look at
the problem. No need for -X stream in the command.

I'll see if I can produce a patch soon.
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeff Janes 2017-06-27 03:14:46 Re: distinct estimate of a hard-coded VALUES list
Previous Message Amit Kapila 2017-06-27 02:06:40 Re: intermittent failures in Cygwin from select_parallel tests