Re: Server crash with Master-Slave configuration. - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: Server crash with Master-Slave configuration.
Date
Msg-id 20191225023127.GF3448@paquier.xyz
Whole thread Raw
In response to Server crash with Master-Slave configuration.  (Prabhat Sahu <prabhat.sahu@enterprisedb.com>)
Responses Re: Server crash with Master-Slave configuration.  (Prabhat Sahu <prabhat.sahu@enterprisedb.com>)
List pgsql-hackers
On Tue, Dec 24, 2019 at 05:29:25PM +0530, Prabhat Sahu wrote:
> While performing below operations with Master-Slave configuration, Slave is
> crashed.
> Below are the steps to reproduce:
>
> -- create a Slave using pg_basebackup and start:
> ./pg_basebackup -v -R -D d2 -p 55510
> mkdir /home/centos/ts1
>
> -- Session 1(Master):
> ./psql postgres -p 55510
>
> CREATE TABLESPACE ts1 location '/home/centos/ts1';

Your mistake is here.  Both primary and standby are on the same host,
so CREATE TABLESPACE would point to a path that overlap for both
clusters as the tablespace path is registered the WAL replayed,
leading to various weird behaviors.  What you need to do instead is to
create the tablespace before taking the base backup, and then take the
base backup using pg_basebackup's --tablespace-mapping.
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: pgsql: Superuser can permit passwordless connections onpostgres_fdw
Next
From: Kyotaro Horiguchi
Date:
Subject: Re: Assert failure due to "drop schema pg_temp_3 cascade" fortemporary tables and \d+ is not showing any info after drooping temp tableschema