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 1hdu44-0003xT-6V for pgsql-admin@arkaria.postgresql.org; Thu, 20 Jun 2019 10:13:08 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hdu42-0004Y5-Q0 for pgsql-admin@arkaria.postgresql.org; Thu, 20 Jun 2019 10:13:06 +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 1hdu42-0004Xx-Dp for pgsql-admin@lists.postgresql.org; Thu, 20 Jun 2019 10:13:06 +0000 Received: from smtp1-g21.free.fr ([2a01:e0c:1:1599::10]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hdu3v-0000ys-CW for pgsql-admin@lists.postgresql.org; Thu, 20 Jun 2019 10:13:05 +0000 Received: from firost (unknown [109.9.175.138]) (Authenticated sender: ioguix) by smtp1-g21.free.fr (Postfix) with ESMTPSA id 0FCC8B00563; Thu, 20 Jun 2019 12:12:52 +0200 (CEST) Date: Thu, 20 Jun 2019 12:12:51 +0200 From: "Jehan-Guillaume (ioguix) de Rorthais" To: Achilleas Mantzios Cc: pgsql-admin@lists.postgresql.org Subject: Re: zero data loss recovery is possbile with pgbackrest tool? Message-ID: <20190620121251.418294c0@firost> In-Reply-To: References: X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Thu, 20 Jun 2019 08:37:21 +0300 Achilleas Mantzios wrote: > On 20/6/19 12:40 =CF=80.=CE=BC., Pavan Kumar wrote: > > Hello Rui, > > > > yes those are committed transaction. > > > > I have tested two cases > > > > 1. complete lost. (means complete data directory, pg_wal direcoty) > > 2. lost few directories (deleted few directories , except pg_wal). > > > > both cases I do see latest data in the current wal is lost. > > > > when I check the recovery process , wal archives are copying from > > pgbackrest repository to pg_wal directory. however pgbackrest tool is n= ot > > copying current wal log at all. it is only copying archived wal's/ > > > > is there any way to copy current wal log with pgbackrest tool? >=20 > No tool that is based on archiving is able to do that. Incomplete wals do= n't > get archived till they are complete. So, you have the risk of losing > (maximum) 16MB worth of data. No, this could be more than 16MB. Archiving might be lagging as well depend= ing on various circumstances and activity. > If you want to minimize the effect of this, you > should set > https://www.postgresql.org/docs/11/runtime-config-wal.html#GUC-ARCHIVE-TI= MEOUT > (|archive_timeout|) to a smaller value . This will still allow data loss. No matter the value. Moreover, there no se= nse setting it bellow eg. 1min. If you want something smaller, you really want replication. If you don't want a secondary in sync, you might want to have a look at pg_receivewal. ++