pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Amir Rohan <amir.rohan@mail.com>
To: Michael Paquier <michael.paquier@gmail.com>
Cc: PostgreSQL mailing lists <pgsql-bugs@postgresql.org>
Subject: Re: BUG #13644: 2xRecovery without new writes, causes archiving failure
Date: Sun, 27 Sep 2015 00:03:58 +0300
Message-ID: <5607083E.7040109@mail.com> (raw)
In-Reply-To: <CAB7nPqTyhwWAFmArf-8C32CRh+aRCx4k=cgw2686fnDfSEpTkw@mail.gmail.com>
References: <20150926032247.3022.98224@wrigleys.postgresql.org>
	<CAB7nPqTyhwWAFmArf-8C32CRh+aRCx4k=cgw2686fnDfSEpTkw@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

On 09/26/2015 02:39 PM, Michael Paquier wrote:
> On Sat, Sep 26, 2015 at 12:22 PM, Amir Rohan wrote:
>> DETAIL:  The failed archive command was: test ! -f
>> /var/lib/pgsql/archive/00000002.history && cp pg_xlog/00000002.history
>> /var/lib/pgsql/archive/00000002.history
> 
> That's a symptom that the second node already selected timeline 2, my
> first guess is that the restore_command for the second node recovered
> failed to get 00000002.history because it may have been set
> incorrectly.
> 

I guess you mean the 3rd node here, which is the 2nd recovery.

You seem to agree that the 3rd node (2nd recovery) picked timeline 2
instead of starting a 3rd. So, at least I have that right.

What does "Set incorrectly" mean in this case? the 2nd node (1st
recovery) creates 00000002.history, I checked.

>> I expected the last server to create timeline 3, but it looks as if it
>> thinks it's timeline2. While in terms of data it's at the same WAL point,
>> in terms of events, it should be at timeline 3. That's what I make
>> of it anyway.
> 
> I am not able to see any problems with neither 9.5 nor HEAD, when
> recovering the second node in your scenario, it fetches correctly
> 00000002.history from the archive in my case and the node is able to
> select the timeline 3 when recovery is pointing to select the latest
> timeline.
> 

I can reproduced this 100% of the time with HEAD from the last few days,
and haven't tried with anything else.

See attached log+shell-script I used to reproduce.
The log shows the contents of the archive directory at various points
in the process I described in the initial post.

Amir

-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

Attachments:

pg.log (text/x-log, 4.5K) download Fixing configuration /tmp/pgtest/data/* server starting LOG: redirecting log output to logging collector process HINT: Future log output will appear in directory "pg_log". >>>==========LOG=========== LOG: database system was shut down at 2015-09-26 23:05:26 IDT LOG: MultiXact member wraparound protections are now enabled LOG: autovacuum launcher started LOG: database system is ready to accept connections <<<==========LOG=========== SELECT 1000 Making backup... total 37576 -rw-r--r--. 1 postgres postgres 38475776 Sep 26 23:05 base.tar waiting for server to shut down.... done server stopped Check archive (after #1 stop) ... -rw-------. 1 postgres postgres 16777216 Sep 26 23:05 /tmp/pgtest/archive/000000010000000000000001 -rw-------. 1 postgres postgres 16777216 Sep 26 23:05 /tmp/pgtest/archive/000000010000000000000002 -rw-------. 1 postgres postgres 302 Sep 26 23:05 /tmp/pgtest/archive/000000010000000000000002.00000028.backup Bringing up 2d server... Fixing configuration /tmp/pgtest/data/* server starting LOG: redirecting log output to logging collector process HINT: Future log output will appear in directory "pg_log". cp: cannot stat ‘/tmp/pgtest/backups/000000010000000000000003’: No such file or directory LOG: redo done at 0/20000B8 cp: cannot stat ‘/tmp/pgtest/backups/000000010000000000000002’: No such file or directory cp: cannot stat ‘/tmp/pgtest/backups/00000002.history’: No such file or directory LOG: selected new timeline ID: 2 cp: cannot stat ‘/tmp/pgtest/backups/00000001.history’: No such file or directory LOG: archive recovery complete LOG: MultiXact member wraparound protections are now enabled LOG: autovacuum launcher started LOG: database system is ready to accept connections waiting for server to shut down.... done server stopped Check archive (after #2 stop) ... -rw-------. 1 postgres postgres 16777216 Sep 26 23:05 /tmp/pgtest/archive/000000010000000000000001 -rw-------. 1 postgres postgres 16777216 Sep 26 23:05 /tmp/pgtest/archive/000000010000000000000002 -rw-------. 1 postgres postgres 302 Sep 26 23:05 /tmp/pgtest/archive/000000010000000000000002.00000028.backup -rw-------. 1 postgres postgres 16777216 Sep 26 23:05 /tmp/pgtest/archive/000000020000000000000002 -rw-------. 1 postgres postgres 16777216 Sep 26 23:05 /tmp/pgtest/archive/000000020000000000000003 -rw-------. 1 postgres postgres 41 Sep 26 23:05 /tmp/pgtest/archive/00000002.history Bringing up 3d server... Fixing configuration /tmp/pgtest/data/* server starting LOG: redirecting log output to logging collector process HINT: Future log output will appear in directory "pg_log". >>>==========LOG=========== cp: cannot stat ‘/tmp/pgtest/backups/000000010000000000000002’: No such file or directory cp: cannot stat ‘/tmp/pgtest/backups/00000002.history’: No such file or directory LOG: selected new timeline ID: 2 cp: cannot stat ‘/tmp/pgtest/backups/00000001.history’: No such file or directory LOG: archive recovery complete LOG: MultiXact member wraparound protections are now enabled LOG: autovacuum launcher started LOG: database system is ready to accept connections LOG: archive command failed with exit code 1 DETAIL: The failed archive command was: test ! -f /tmp/pgtest/archive/00000002.history && cp pg_xlog/00000002.history /tmp/pgtest/archive/00000002.history LOG: archive command failed with exit code 1 DETAIL: The failed archive command was: test ! -f /tmp/pgtest/archive/00000002.history && cp pg_xlog/00000002.history /tmp/pgtest/archive/00000002.history LOG: archive command failed with exit code 1 DETAIL: The failed archive command was: test ! -f /tmp/pgtest/archive/00000002.history && cp pg_xlog/00000002.history /tmp/pgtest/archive/00000002.history WARNING: archiving transaction log file "00000002.history" failed too many times, will try again later <<<==========LOG=========== Check archive (after #3 start) ... -rw-------. 1 postgres postgres 16777216 Sep 26 23:05 /tmp/pgtest/archive/000000010000000000000001 -rw-------. 1 postgres postgres 16777216 Sep 26 23:05 /tmp/pgtest/archive/000000010000000000000002 -rw-------. 1 postgres postgres 302 Sep 26 23:05 /tmp/pgtest/archive/000000010000000000000002.00000028.backup -rw-------. 1 postgres postgres 16777216 Sep 26 23:05 /tmp/pgtest/archive/000000020000000000000002 -rw-------. 1 postgres postgres 16777216 Sep 26 23:05 /tmp/pgtest/archive/000000020000000000000003 -rw-------. 1 postgres postgres 41 Sep 26 23:05 /tmp/pgtest/archive/00000002.history waiting for server to shut down....... done server stopped
2xrecovery.sh (application/x-shellscript, 2.5K) download

view thread (5+ messages)  latest in thread

Message-ID: <5607083E.7040109@mail.com>
Permalink:  ../5607083E.7040109@mail.com/
Also on:    postgresql.org/message-id/5607083E.7040109@mail.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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: amir.rohan@mail.com, michael.paquier@gmail.com
  Subject: Re: BUG #13644: 2xRecovery without new writes, causes archiving failure
  In-Reply-To: <5607083E.7040109@mail.com>
  References: <20150926032247.3022.98224@wrigleys.postgresql.org> <CAB7nPqTyhwWAFmArf-8C32CRh+aRCx4k=cgw2686fnDfSEpTkw@mail.gmail.com> <5607083E.7040109@mail.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