pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: leif@lako.no
To: pgsql-hackers@lists.postgresql.org
Subject: Fwd: Re: BUG #15589: Due to missing wal, restore ends prematurely and opens database for read/write
Date: Wed, 30 Jan 2019 15:53:51 +0000
Message-ID: <a3bf3b8910cd5adb8a5fbc8113eac0ab@lako.no> (raw)
In-Reply-To: <d8b925764876064175d94447e698ec69@lako.no>
References: <d8b925764876064175d94447e698ec69@lako.no>
	<CAMkU=1ym=UYLVS37NNSE547Uw0_xPJUuBmyZPqEHARd=Un6eiA@mail.gmail.com>
	<15589-8e6e353a97b085fb@postgresql.org>

Hi
I have reported a bug via PostgreSQL bug report form, but havent got any response so far.
This might not be a bug, but a feature not implemented yet.
I suggest to make a small addition to StartupXLOG to solve the issue.



git diff src/backend/access/transam/xlog.c
inline patch 1: src/backend/access/transam/xlog.c (+13/-0 lines) download inline-1.patchdiff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c index 2ab7d804f0..d0e5bb3f84 100644 --- a/src/backend/access/transam/xlog.c +++ b/src/backend/access/transam/xlog.c @@ -7277,6 +7277,19 @@ StartupXLOG(void) case RECOVERY_TARGET_ACTION_PROMOTE: break; + } + } else if (recoveryTarget == RECOVERY_TARGET_TIME) + { + /* + * Stop point not reached but next WAL could not be read + * Some explanation and warning should be logged + */ + switch (recoveryTargetAction) + { + case RECOVERY_TARGET_ACTION_PAUSE: + SetRecoveryPause(true); + recoveryPausesHere(); + break; } }
The scenario I want to solve is: Need to restore backup to another server. Restores pgbasebackup files Restores som wal-files Extract pgbasebackup files creates recover.conf with pit Starts postgresql recover ends before pit due to missing wal-files database opens read/write I think database should have paused recovery then I could restore additional wal-files and restart postgresql to continue with recover. With large databases and a lot of wal-files it is time consuming to repeat parts of the process. Best regards Leif Gunnar Erlandsen

view thread (10+ messages)  latest in thread

Message-ID: <a3bf3b8910cd5adb8a5fbc8113eac0ab@lako.no>
Permalink:  ../a3bf3b8910cd5adb8a5fbc8113eac0ab@lako.no/
Also on:    postgresql.org/message-id/a3bf3b8910cd5adb8a5fbc8113eac0ab@lako.no

 ·  · 

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: leif@lako.no, pgsql-hackers@lists.postgresql.org
  Subject: Re: Fwd: Re: BUG #15589: Due to missing wal, restore ends prematurely and opens database for read/write
  In-Reply-To: <a3bf3b8910cd5adb8a5fbc8113eac0ab@lako.no>
  References: <d8b925764876064175d94447e698ec69@lako.no> <CAMkU=1ym=UYLVS37NNSE547Uw0_xPJUuBmyZPqEHARd=Un6eiA@mail.gmail.com> <15589-8e6e353a97b085fb@postgresql.org> <a3bf3b8910cd5adb8a5fbc8113eac0ab@lako.no>

* 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