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 1i34id-0002Am-TH for pgsql-admin@arkaria.postgresql.org; Wed, 28 Aug 2019 20:39:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1i34ic-00059m-QB for pgsql-admin@arkaria.postgresql.org; Wed, 28 Aug 2019 20:39:02 +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 1i34ic-00055U-Ec for pgsql-admin@lists.postgresql.org; Wed, 28 Aug 2019 20:39:02 +0000 Received: from impout009aa.msg.chrl.nc.charter.net ([47.43.20.33] helo=impout009.msg.chrl.nc.charter.net) by makus.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1i34iZ-0004eo-Um for pgsql-admin@lists.postgresql.org; Wed, 28 Aug 2019 20:39:01 +0000 Received: from cerberus.crazybean.net ([24.151.10.150]) by cmsmtp with ESMTP id 34iOibeNIiYmu34iOis5Qo; Wed, 28 Aug 2019 20:38:49 +0000 Authentication-Results: crazybean.net; none X-Authority-Analysis: v=2.3 cv=S41tP7kP c=1 sm=1 tr=0 a=D2HTw/M6/8MmcHighGO7rg==:117 a=D2HTw/M6/8MmcHighGO7rg==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=xqWC_Br6kY4A:10 a=FmdZ9Uzk2mMA:10 a=pGLkceISAAAA:8 a=oIfrFNJ-AAAA:8 a=vzx-ASqP7w-45KJZin8A:9 a=QxMBYQ77PouqE210:21 a=8kNMVsaxSKSwhSdQ:21 a=QEXdDO2ut3YA:10 a=GmORBOsRYZbcRJgY_BIA:9 a=1HElT1tlUU1ZBB0v:21 a=S9CrCHPPCYbVYDwg:21 a=6ZB_T8DGLvWw2O_9:21 a=_W_S_7VecoQA:10 a=Cg2NcamS17xU0rR7el6q:22 Received: from [IPv6:2001:470:e117:4:f1b1:7ed9:a416:c22e] (2001:470:e117:4:f1b1:7ed9:a416:c22e [IPv6:2001:470:e117:4:f1b1:7ed9:a416:c22e]) by cerberus.crazybean.net (OpenSMTPD) with ESMTPSA id 62916f45 (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO); Wed, 28 Aug 2019 16:38:48 -0400 (EDT) From: Rui DeSousa Message-Id: <4BB72752-69DB-4ADA-A92F-4B7EE238A3EA@crazybean.net> Content-Type: multipart/alternative; boundary="Apple-Mail=_BF2C93D8-A70F-4EC2-923C-6708B849B5E0" Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: Backup From HotStandby Date: Wed, 28 Aug 2019 16:38:47 -0400 In-Reply-To: Cc: Jeff Janes , pgsql-admin@lists.postgresql.org To: Licio Matos References: <61A32609-4552-4F4D-9B88-EF15C06010C1@crazybean.net> <1F62FCE5-E2AB-4307-81C4-859208B24865@crazybean.net> X-Mailer: Apple Mail (2.3445.104.11) X-CMAE-Envelope: MS4wfIlVJNtIzfVd0TJisIxwBt+tTWD4+LNcidD/qbIsRLPUWB+ZivukcHg7vGNsvG21UGIMBYDMRPNhKzV+hsM+rvkVxPEFxcdSJIMr67KAYNl+7+3ZRz+I JV/+j5J5ApWW5P+9K0R/u0R8YGQCJT5JYmhxQDlYPSF7gEoJoJCeI0sfmy3HOBUU2mgZVLyKTczLp/OLAqPP9rE2wuhcL4J9lwqkJwOd/XctBcGslwElbf6+ rbnkk4EqQF7b8OQ6AJz1oig0FquTxPttxfoxIVmSt7Y= List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --Apple-Mail=_BF2C93D8-A70F-4EC2-923C-6708B849B5E0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Aug 28, 2019, at 4:11 PM, Licio Matos = wrote: >=20 > @Rui DeSousa =20 >=20 > I am running this on the primary, the question is if i can run this = same script on the replica. >=20 You can based on what you told me about the snapshot; however, the = pg_start_backup() command will fail. =20 Note: What you are doing today most would consider it a =E2=80=9Cproper=E2= =80=9D online backup; when you start running the script on the replica = then you will end up with a =E2=80=9Ccrashed=E2=80=9D backup. The = =E2=80=9Ccrashed=E2=80=9D backup only works as you can guarantee a point = in time atomic view of all the data files using a single atomic = snapshot. You need to remove the pg_start_backup() and pg_stop_backup() commands = from the script. The backup should occur faster as it is no longer = waiting on pg_start_backup() to issue checkpoint; however, that also = means that recovery times increase for the same reason. =20 --Apple-Mail=_BF2C93D8-A70F-4EC2-923C-6708B849B5E0 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8

On Aug 28, 2019, at 4:11 PM, Licio Matos <licio.matos@gmail.com> wrote:

@Rui = DeSousa 

I = am running this on the primary, the question is if i can run this same = script on the replica.


You = can based on what you told me about the snapshot; however, the = pg_start_backup() command will fail.  

Note: What you are doing today most would consider = it a =E2=80=9Cproper=E2=80=9D online backup; when you start running the = script on the replica then you will end up with a =E2=80=9Ccrashed=E2=80=9D= backup.   The =E2=80=9Ccrashed=E2=80=9D backup only works as you = can guarantee a point in time atomic view of all the data files using a = single atomic snapshot.

You need to = remove the pg_start_backup() and pg_stop_backup() commands from the = script.   The backup should occur faster as it is no longer waiting = on pg_start_backup() to issue checkpoint; however, that also means that = recovery times increase for the same reason.  

= --Apple-Mail=_BF2C93D8-A70F-4EC2-923C-6708B849B5E0--