Thread: error on online backup using pg_basebackup tool

error on online backup using pg_basebackup tool

From
Gerdan Rezende dos Santos
Date:
Hi 4 all!!

As Ido not know if it is my mistake or actually a bug, sending the two topics.

When trying to perform online backup using the pg_basebackup tool, I get the message: The folder is not empty.

steps to reproduce the error:
1 - install postgres in the / usr / local / pgsql
2 - initialize the database: / usr / local / pgsql / bin / -D /data
3 - set up pg_hba.conf to allow replication (used by online backup with pg_basebackup)
4 - create the directories /data/newtblspc and /data/pg_tblspc/newtblspc2
5 - start with postgres -D /data
6 - create table spaces:
CREATE TABLESPACE newtblspc LOCATION '/data/newtblspc';
CREATE TABLESPACE newtblspc2 LOCATION '/data/pg_tblspc/newtblspc2'
7 - mkdir /data2
8 - Now perform a backup using pg_basebackup -D /data2 and get the error message.





--
T.'.A.'.F.'.,
Gerdan Rezende dos Santos
Po
stgreSQL & EnterpriseDB Specialist, Support, Training & Services
+55 (61) 9645-1525

Re: error on online backup using pg_basebackup tool

From
Michael Paquier
Date:
On Thu, Sep 3, 2015 at 10:28 AM, Gerdan Rezende dos Santos
<gerdan@gmail.com> wrote:
> 6 - create table spaces:
> CREATE TABLESPACE newtblspc LOCATION '/data/newtblspc';
> CREATE TABLESPACE newtblspc2 LOCATION '/data/pg_tblspc/newtblspc2'
> 7 - mkdir /data2
> 8 - Now perform a backup using pg_basebackup -D /data2 and get the error
> message.

You are performing a base backup on a node that has tablespaces on the
same hosts, so tablespaces are going to overlap. Isn't that your
problem? Note that 9.4 you can use tablespace-mapping to address the
problem, for older versions you are going to need some manual
operations before being able to run the standby and the master on the
same server.
--
Michael


Re: error on online backup using pg_basebackup tool

From
Gerdan Rezende dos Santos
Date:

I use the tablespaces without problem but the backup online not complete... but when I attempt to online backup using the pg_basebackup displays the error message saying q pg_tblspc is not clean and the process is terminated without sucess


Em quarta-feira, 2 de setembro de 2015, Michael Paquier <michael.paquier@gmail.com> escreveu:
On Thu, Sep 3, 2015 at 10:28 AM, Gerdan Rezende dos Santos
<gerdan@gmail.com> wrote:
> 6 - create table spaces:
> CREATE TABLESPACE newtblspc LOCATION '/data/newtblspc';
> CREATE TABLESPACE newtblspc2 LOCATION '/data/pg_tblspc/newtblspc2'
> 7 - mkdir /data2
> 8 - Now perform a backup using pg_basebackup -D /data2 and get the error
> message.

You are performing a base backup on a node that has tablespaces on the
same hosts, so tablespaces are going to overlap. Isn't that your
problem? Note that 9.4 you can use tablespace-mapping to address the
problem, for older versions you are going to need some manual
operations before being able to run the standby and the master on the
same server.
--
Michael


--
T.'.A.'.F.'.,
Gerdan Rezende dos Santos
Po
stgreSQL & EnterpriseDB Specialist, Support, Training & Services
+55 (61) 9645-1525

Re: error on online backup using pg_basebackup tool

From
Michael Paquier
Date:
On Thu, Sep 3, 2015 at 12:20 PM, Gerdan Rezende dos Santos
<gerdan@gmail.com> wrote:
>[...]

Note 1: Please don't top-post.
Note 2: Please don't post across multiple mailing lists.

> I use the tablespaces without problem but the backup online not complete...
> but when I attempt to online backup using the pg_basebackup displays the
> error message saying q pg_tblspc is not clean and the process is terminated
> without sucess.

That's what I am saying. You will need to redirect manually the soft
links of pg_tbspc into other paths if you want to run a standby on the
same host as the master.

That's not a bug, just an operation mistake.
--
Michael