Re: WAL archive is lost

From: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
To: "matsumura(dot)ryo(at)fujitsu(dot)com" <matsumura(dot)ryo(at)fujitsu(dot)com>
Cc: Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: WAL archive is lost
Date: 2019-11-23 14:10:35
Message-ID: CAMkU=1zAeWh7jdFmHw5R9sjJpzq9fKwMxiYp1-m+JOY2Bi1rsg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Nov 22, 2019 at 8:04 AM matsumura(dot)ryo(at)fujitsu(dot)com <
matsumura(dot)ryo(at)fujitsu(dot)com> wrote:

> Hi all
>
> I find a situation that WAL archive file is lost but any WAL segment file
> is not lost.
> It causes for archive recovery to fail. Is this behavior a bug?
>
> example:
>
> WAL segment files
> 000000010000000000000001
> 000000010000000000000002
> 000000010000000000000003
>
> Archive files
> 000000010000000000000001
> 000000010000000000000003
>
> Archive file 000000010000000000000002 is lost but WAL segment files
> is continuous. Recovery with archive (i.e. PITR) stops at the end of
> 000000010000000000000001.
>

Will it not archive 000000010000000000000002 eventually, like at the
conclusion of the next restartpoint? or does it get recycled/removed
without ever being archived? Or does it just hang out forever in pg_wal?

> How to reproduce:
> - Set up replication (primary and standby).
> - Set [archive_mode = always] in standby.
> - WAL receiver exits (i.e. because primary goes down)
> after receiver inserts the last record in some WAL segment file
> before receiver notifies the segement file to archiver(create .ready
> file).
>

Do you have a trick for reliably achieving this last step?

Cheers,

Jeff

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Joe Conway 2019-11-23 15:51:54 Re: add a MAC check for TRUNCATE
Previous Message Amit Kapila 2019-11-23 11:12:10 Re: dropdb --force