[HACKERS] pg_basebackup fails on Windows when using tablespace mapping - Mailing list pgsql-hackers

From nb
Subject [HACKERS] pg_basebackup fails on Windows when using tablespace mapping
Date
Msg-id 4e641357-69bb-d09b-9174-cb08facb94b8@gmail.com
Whole thread Raw
Responses Re: [HACKERS] pg_basebackup fails on Windows when using tablespace mapping
List pgsql-hackers

Summary:

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".

Version: 9.6.2, installed from Standard EDB package (built with MSVC).


Repro steps:

1. Have a cluster running on Windows (you'll need max_wal_senders at least 2 and wal_level replica for pg_basebackup -X stream)

2. create tablespace testspc location 'somedisk:\some\location'; -- Slash direction is irrelevant

3. run `pg_basebackup -T somedisk:\some\location=somedisk:\new\location -X stream -D somedisk:\some\other_location -h 127.0.0.1 -U postgres`

The error should read:

pg_basebackup: directory "somedisk:\some\location" exists but is not empty

---

This was discussed today in IRC. As a temporary solution it was suggested to add 'canonicalize_path(buf);' before return in /src/port/dirmod.c:336


** DISCLAMER: note that value of r is not adjusted, so this is not a production ready fix in any way. **


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.


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.


Kind regards,

Nick.

pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: [HACKERS] Another reason why the recovery tests take a long time
Next
From: Jeevan Ladhe
Date:
Subject: Re: [HACKERS] fix empty array expression in get_qual_for_list()