From: Stephen Frost <sfrost@snowman.net>
To: AYahorau@ibagroup.eu
Cc: Shreeyansh Dba <shreeyansh2014@gmail.com>
Cc: MikalaiKeida@ibagroup.eu, pgsql-admin <pgsql-admin@postgresql.org>
Subject: Re: pg_basebackup fails: could not receive data from WAL stream: server closed the connection unexpectedly
Date: Tue, 4 Dec 2018 09:05:12 -0500
Message-ID: <20181204140512.GO3415@tamriel.snowman.net> (raw)
In-Reply-To: <OF4CC3D4EF.4E5A434D-ON43258359.0044B5C1-43258359.004655F6@iba.by>
References: <OF54569A25.1AF98674-ON43258358.002D80F2-43258358.00304DB9@iba.by>
<CAGDYbUPqEkPf9Y113AdaSUv33m27Z5xyjnykFDYzmTUqy+dk_A@mail.gmail.com>
<OF4CC3D4EF.4E5A434D-ON43258359.0044B5C1-43258359.004655F6@iba.by>
Greetings,
* AYahorau@ibagroup.eu (AYahorau@ibagroup.eu) wrote:
> I reckon we can return to more conventional approach of postgres db
> synchronization:
> 1) SELECT pg_start_backup('label', true);
> 2) rsync/cp $PGDATA directory;
> 3) SELECT pg_stop_backup();
It doesn't seem clear what the goal here is- if you are looking to have
two DB servers that are synchronized, then using pg_basebackup to get
the initial copy and then running PostgreSQL as a replica would be the
right approach.
I certainly wouldn't recommend trying to hack together something with
rsync or cp or using the exclusive backup mode at all- if the system
crashes when that exclusive backup is happening, the database won't come
back up.
> I have a question. What is your opinion about pg_basebackup utility and
> its behaviour for this condition? Is it a bug? Should it be fixed?
No, I don't see any bug here, but if you adjust the timeout values on
the server then you need to tell pg_basebackup to send messages to the
server more frequently or it's going to get timed out. That's what the
--status-interval option in pg_basebackup is for.
Thanks!
Stephen
Attachments:
signature.asc (application/pgp-signature, 818B) download
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: sfrost@snowman.net, AYahorau@ibagroup.eu, shreeyansh2014@gmail.com
Subject: Re: pg_basebackup fails: could not receive data from WAL stream: server closed the connection unexpectedly
In-Reply-To: <20181204140512.GO3415@tamriel.snowman.net>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox