pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: TAKATSUKA Haruka <harukat@sraoss.co.jp>
To: Michael Paquier <michael@paquier.xyz>
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #15402: Hot standby server with archive_mode=on keeps initial WAL segments
Date: Wed, 26 Sep 2018 13:36:40 +0900
Message-ID: <20180926133640.99bfbc7ea82f71aa91a02c11@sraoss.co.jp> (raw)
In-Reply-To: <20180926035205.GJ1659@paquier.xyz>
References: <15402-a453c90ed4cf88b2@postgresql.org>
	<20180926035205.GJ1659@paquier.xyz>

Hello Michael,

Firstly, I will tell the reproduce steps.

On Wed, 26 Sep 2018 12:52:05 +0900
Michael Paquier <michael@paquier.xyz> wrote:

> On Wed, Sep 26, 2018 at 03:26:50AM +0000, PG Bug reporting form wrote:
> > A hot standby server with “archive_mode = on” keeps initial WAL segment
> > files that copied by pg_basebackup. It shows the following status.
> > 000000010000000000000042 will be kept forever in this case.
> 
> How did you find yourself in this situation?  Did you take a base backup
> from a primary which had .ready files in it, and those got copied to the
> standby's data folder?  We may want to study the possibility of
> filtering things when taking a base backup instead.

I can reproduce it by this steps.

  $ pg_basebackup -D data_standby -R -Xs
  $ pg_ctl start -D data_standby -o '-p 5433'
  $ pgbench -i ; pgbench -i ; pgbench -i 
  $ psql -c 'checkpoint' ; psql -p 5433 -c 'checkpoint'
  $ ls data_standby/pg_wal ; ls data_standby/pg_wal/archive_status/

  postgresql.conf:
    archive_mode = on
    archive_command = 'cp %p /tmp/arc/%f'
    max_wal_size = 160MB

There are no .ready files right after pg_basebackup.
It will be generated after the replication starts.

Thnaks,
Haruka Takatsuka


> > Though I understand renaming the .ready to .done manually can clean it,
> > I would like to fix the server code like the following patch.
> > I'd appreciate if you would consider that.
> 
> Your patch looks incorrect to me to begin with...  What if archive_mode
> is switched from "on" to "always" back-and-forth and there some of the
> past segments which should be archived are not?
> --
> Michael





view thread (9+ messages)  latest in thread

Message-ID: <20180926133640.99bfbc7ea82f71aa91a02c11@sraoss.co.jp>
Permalink:  ../20180926133640.99bfbc7ea82f71aa91a02c11@sraoss.co.jp/
Also on:    postgresql.org/message-id/20180926133640.99bfbc7ea82f71aa91a02c11@sraoss.co.jp

 · 

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-bugs@postgresql.org
  Cc: harukat@sraoss.co.jp, michael@paquier.xyz, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #15402: Hot standby server with archive_mode=on keeps initial WAL segments
  In-Reply-To: <20180926133640.99bfbc7ea82f71aa91a02c11@sraoss.co.jp>

* 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