pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: eshkinkot@gmail.com
To: pgsql-bugs@postgresql.org
Subject: BUG #12128: Cannot start backup again if it shutdown after replay one *.history file.
Date: Tue, 02 Dec 2014 13:17:02 +0000
Message-ID: <20141202131702.2554.48300@wrigleys.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

The following bug has been logged on the website:

Bug reference:      12128
Logged by:          Sergey Burladyan
Email address:      eshkinkot@gmail.com
PostgreSQL version: 9.2.9
Operating system:   Slackware 14.1
Description:        

I try to start new slave but was wrong with archive and new slave restore
only one history file,
without any WALs. So I stop new slave, fix problem and start it again, but
it cannot start now.

I do something like this (use archive without streaming):
1. create master
2. create slave
3. kill master, promote slave and wait 00000002.history in archive
4. create new slave from new master
5. backup from new slave
6. start from backup, replay only one history file
(I do this trick for restore only *.history file for reproduce the error)
=== recovery.conf ===
restore_command = 'if [[ %f = *.history ]]; then cp ~/tmp/w/%f %p; else
false; fi'
recovery_target_timeline = 'latest'
standby_mode = on

$ /usr/lib64/postgresql/9.2/bin/postgres -D b -p 5430
LOG:  database system was interrupted while in recovery at log time
2014-12-02 15:32:14 MSK
HINT:  If this has occurred more than once some data might be corrupted and
you might need to choose an earlier recovery target.
LOG:  creating missing WAL directory "pg_xlog/archive_status"
cp: cannot stat ‘/home/sergey/tmp/w/00000003.history’: No such file or
directory
LOG:  restored log file "00000002.history" from archive
LOG:  entering standby mode
cp: cannot stat ‘/home/sergey/tmp/w/00000003.history’: No such file or
directory
cp: cannot stat ‘/home/sergey/tmp/w/00000003.history’: No such file or
directory
^CLOG:  received fast shutdown request
LOG:  shutting down
LOG:  database system is shut down


7. shutdown it and allow restore WALs, but now slave from backup cannot
start again
=== recovery.conf ===
restore_command = 'cp ~/tmp/w/%f %p'
recovery_target_timeline = 'latest'
standby_mode = on

LOG:  database system was shut down in recovery at 2014-12-02 15:54:34 MSK
cp: cannot stat ‘/home/sergey/tmp/w/00000003.history’: No such file or
directory
LOG:  restored log file "00000002.history" from archive
LOG:  entering standby mode
LOG:  restored log file "00000002000000000000000B" from archive
FATAL:  backup_label contains data inconsistent with control file
HINT:  This means that the backup is corrupted and you will have to use
another backup for recovery.
LOG:  startup process (PID 10821) exited with exit code 1
LOG:  aborting startup due to startup process failure

$ diff -urN <(pg_controldata b_org/) <(pg_controldata b/)
inline patch 1: /dev/fd/62 (+2/-2 lines) download inline-1.patch--- /dev/fd/63 2014-12-02 15:58:15.685046719 +0300 +++ /dev/fd/62 2014-12-02 15:58:15.686046721 +0300 @@ -1,8 +1,8 @@ pg_control version number: 922 Catalog version number: 201204301 Database system identifier: 6088213639255289694 -Database cluster state: in archive recovery -pg_control last modified: Вт 02 дек 2014 15:32:25 +Database cluster state: shut down in recovery +pg_control last modified: Вт 02 дек 2014 15:54:34 Latest checkpoint location: 0/B000058 Prior checkpoint location: 0/8000058 Latest checkpoint's REDO location: 0/B000020
so, looks like after database cluster state changed to "shut down in recovery" it cannot start again from backup. -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs

Message-ID: <20141202131702.2554.48300@wrigleys.postgresql.org>
Permalink:  ../20141202131702.2554.48300@wrigleys.postgresql.org/
Also on:    postgresql.org/message-id/20141202131702.2554.48300@wrigleys.postgresql.org

 ·  · 

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: eshkinkot@gmail.com
  Subject: Re: BUG #12128: Cannot start backup again if it shutdown after replay one *.history file.
  In-Reply-To: <20141202131702.2554.48300@wrigleys.postgresql.org>
  References: <20141202131702.2554.48300@wrigleys.postgresql.org>

* 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