pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Achilleas Mantzios <achill@matrix.gatewaynet.com>
To: pgsql-admin@lists.postgresql.org
Subject: Re: zero data loss recovery is possbile with pgbackrest tool?
Date: Thu, 20 Jun 2019 08:37:21 +0300
Message-ID: <a1eda6cc-cbe9-4859-52e8-b73fe7dd097c@matrix.gatewaynet.com> (raw)
In-Reply-To: <CA+M0sHEamU3hs5b6FJSkRLG5yxhzrZyLCF2fNmxtXzjRzzhcuA@mail.gmail.com>
References: <CA+M0sHHPcx7n-n+OSL4QZ1wm4-qWNEzktCmrFmau2earuZRVhA@mail.gmail.com>
	<e158d1c5-c0a8-24d0-ce74-7706782a8391@gmail.com>
	<E776AABE-8CB4-4078-B9BA-40688E919AF3@crazybean.net>
	<CA+M0sHEamU3hs5b6FJSkRLG5yxhzrZyLCF2fNmxtXzjRzzhcuA@mail.gmail.com>

On 20/6/19 12:40 π.μ., 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 not 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?

No tool that is based on archiving is able to do that. Incomplete wals don't get archived till they are complete. So, you have the risk of losing (maximum) 16MB worth of data.
If you want to minimize the effect of this, you should set https://www.postgresql.org/docs/11/runtime-config-wal.html#GUC-ARCHIVE-TIMEOUT (|archive_timeout|) to a smaller value .
In order to achieve zero data loss, in general, you have to use a tool that can support synchronous streaming replication. For an overview you may look here :
https://severalnines.com/blog/current-state-open-source-backup-management-postgresql

>
>
> On Wed, Jun 19, 2019 at 4:33 PM Rui DeSousa <rui@crazybean.net <mailto:rui@crazybean.net>> wrote:
>
>
>
>     > On Jun 19, 2019, at 5:23 PM, Ron <ronljohnsonjr@gmail.com <mailto:ronljohnsonjr@gmail.com>> wrote:
>     >
>     > Set the checkpoint timeout to something closer to what you want.
>     >
>     >
>
>     Checkpoint does not matter.
>
>     You shouldn’t loose committed transactions.  Was the transaction committed? Do you have all the WALs?
>
>
>
>
>
> -- 
> *Regards,
>
> #!  Pavan Kumar
> ----------------------------------------------*-
> *Sr. Database Administrator..!*
> *NEXT GENERATION PROFESSIONALS, LLC*
> *Cell    #  267-799-3182 #  pavan.dba27 (Gtalk) *
> *India   # 9000459083*
>
>     *Take Risks; if you win, you will be very happy. If you lose you will be Wise *
>


-- 
Achilleas Mantzios
IT DEV Lead
IT DEPT
Dynacom Tankers Mgmt

view thread (8+ messages)  latest in thread

Message-ID: <a1eda6cc-cbe9-4859-52e8-b73fe7dd097c@matrix.gatewaynet.com>
Permalink:  ../a1eda6cc-cbe9-4859-52e8-b73fe7dd097c@matrix.gatewaynet.com/
Also on:    postgresql.org/message-id/a1eda6cc-cbe9-4859-52e8-b73fe7dd097c@matrix.gatewaynet.com

 · 

reply

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: achill@matrix.gatewaynet.com, pgsql-admin@lists.postgresql.org
  Subject: Re: zero data loss recovery is possbile with pgbackrest tool?
  In-Reply-To: <a1eda6cc-cbe9-4859-52e8-b73fe7dd097c@matrix.gatewaynet.com>

* 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