Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gUBK9-0008AW-Qv for pgsql-admin@arkaria.postgresql.org; Tue, 04 Dec 2018 14:05:17 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gUBK8-0000LC-Hf for pgsql-admin@arkaria.postgresql.org; Tue, 04 Dec 2018 14:05:16 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gUBK8-0000L3-6a for pgsql-admin@lists.postgresql.org; Tue, 04 Dec 2018 14:05:16 +0000 Received: from tamriel.snowman.net ([2001:470:e38f::11]) by makus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gUBK5-0008Aa-Er for pgsql-admin@postgresql.org; Tue, 04 Dec 2018 14:05:15 +0000 Received: by tamriel.snowman.net (Postfix, from userid 1000) id D62A45F7A6; Tue, 4 Dec 2018 09:05:12 -0500 (EST) Date: Tue, 4 Dec 2018 09:05:12 -0500 From: Stephen Frost To: AYahorau@ibagroup.eu Cc: Shreeyansh Dba , MikalaiKeida@ibagroup.eu, pgsql-admin Subject: Re: pg_basebackup fails: could not receive data from WAL stream: server closed the connection unexpectedly Message-ID: <20181204140512.GO3415@tamriel.snowman.net> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="NM37ziO8UWI0yLjf" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --NM37ziO8UWI0yLjf Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Greetings, * AYahorau@ibagroup.eu (AYahorau@ibagroup.eu) wrote: > I reckon we can return to more conventional approach of postgres db=20 > 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= =20 > 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 --NM37ziO8UWI0yLjf Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCgAGBQJcBomYAAoJEO1sijiDR2RVBjYP/2m/YunPSrbb11dZiwu4RYBK 35O5McxUifXP+Vz1oXN5WPQpNloCcQRsVJPdn+fr1L9MGFiEYlpFzRvx6Yv4u+Cu TEEILkrCAMHPwDRf7AksT8Yp+GWbLiv8ed3mj3IMj4ZwQYJA9vvF9V3lt0C0lfGg SXTn+At1JG4KdapRWSBD0bfxTENmNWzqN+LvGC/be0FCrRwXDswUh6/4moVS0hOK qtg06+C0R3A1MSygN8qXLvsVkTuYqfhO0Aee1AdA5EXCyL3FRmHK/j0EamF19fzb qQfrA3nPrdvJGmRIw6J7pT07W475ZeNjFWxSjtp5ZCc+TGCLY59F5Wm86YnfFVlv yOIYemOquZc2zUebuEdJU+oPTKj2IL+bX4OlSoT32eyImDJ/vibbA2PkjmjY1Ni6 zXqOwtEe2NxHROMCZ47HnbemX+TZhgVMq/D+ppcYpGh4PNpaniLVQf5+ia5DHhlu ZWApsmlM4JdVoJoEQur/UG+RKj+RJWfyaUxJLqslvW76Djf4BnxUANMgPEs8c0Mo eJeGPsb9b3dwO6SZrCADtQdP3XnhM/ksVzCcRsoKJcWDQWjhD23dEi7B6U3dzMWB CauMc3CmwCehtt1ZfWQ/LQ+VYJOiO/LVvXDMUaKG9uk4cjHXdAMH6FP6rqGmEOeA ht1dTerb9WUjIvkc/Fjf =nXh6 -----END PGP SIGNATURE----- --NM37ziO8UWI0yLjf--