Re: [HACKERS] pg_basebackup fails on Windows when using tablespace mapping

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: [HACKERS] pg_basebackup fails on Windows when using tablespace mapping
Дата
Msg-id CAB7nPqT9Ej0J03BGUJPKXKhnFxapts2RNe-Z4ZdE4qFrppHEyQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [HACKERS] pg_basebackup fails on Windows when using tablespace mapping  (Michael Paquier <michael.paquier@gmail.com>)
Ответы Re: [HACKERS] pg_basebackup fails on Windows when using tablespace mapping  (Ashutosh Sharma <ashu.coek88@gmail.com>)
Список pgsql-hackers
On Tue, Jun 27, 2017 at 12:13 PM, Michael Paquier
<michael.paquier@gmail.com> wrote:
> 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..

The problem is in pg_basebackup.c's get_tablespace_mapping(), which
fails to provide a correct comparison for the directory given by
caller. In your case the caller of get_tablespace_mapping() uses
backslashes as directory value (path value received from backend), and
the tablespace mapping uses slashes as canonicalize_path has been
called once on it. Because of this inconsistency, the directory of the
original tablespace is used, causing the backup to fail as it should.
A simple fix is to make sure that the comparison between both things
is consistent by using canonicalize_path on the directory value given
by caller.

Attached is a patch. I am parking that in the next CF so as this does
not get forgotten as a bug fix. Perhaps a committer will show up
before. Or not.
-- 
Michael

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Jeff Janes
Дата:
Сообщение: Re: [HACKERS] distinct estimate of a hard-coded VALUES list
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: [HACKERS] Modifing returning value of PQgetvalue.