Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1giCKy-0001u0-JX for pgsql-bugs@arkaria.postgresql.org; Sat, 12 Jan 2019 06:00:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1giCKw-0002i5-5z for pgsql-bugs@arkaria.postgresql.org; Sat, 12 Jan 2019 06:00:02 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1giCKv-0002hm-ME for pgsql-bugs@lists.postgresql.org; Sat, 12 Jan 2019 06:00:01 +0000 Received: from server2.lako.no ([77.235.58.136]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1giCKs-0003hb-5K for pgsql-bugs@lists.postgresql.org; Sat, 12 Jan 2019 06:00:00 +0000 Received: from webmail.lako.no (localhost [127.0.0.1]) (authenticated bits=0) by server2.lako.no (8.14.7/8.14.7) with ESMTP id x0C5xsEQ038269 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 12 Jan 2019 06:59:54 +0100 MIME-Version: 1.0 Date: Sat, 12 Jan 2019 05:59:54 +0000 Content-Type: multipart/alternative; boundary="--=_RainLoop_322_651993250.1547272794" X-Mailer: RainLoop/1.12.1 From: leif@lako.no Message-ID: <179d68685819a53bda2101bc999297d3@lako.no> Subject: Re: BUG #15589: Due to missing wal, restore ends prematurely and opens database for read/write To: "Jeff Janes" , pgsql-bugs@lists.postgresql.org In-Reply-To: References: <15589-8e6e353a97b085fb@postgresql.org> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk ----=_RainLoop_322_651993250.1547272794 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable "Jeff Janes" )> skrev 11. januar 2019 kl. 15:03= :=0A On Fri, Jan 11, 2019 at 4:08 AM PG Bug reporting form wrote: =0APostgreSQL should ha= ve paused recovery also on the first scenario. Then I=0Acould have added = missing wal and continued with restore. =0AI agree with you that somethin= g here is not very user friendly. But the counter argument is that you sh= ould not be hiding WAL files from the system in the first place. Once it = is told that the file doesn't exist, it doesn't make sense to pause becau= se non-existence is usually permanent, so there is nothing to be done aft= er a pause. Or in other words, the pause feature is to let you change you= r mind about what time point you want to recover to (moving it only forwa= rd), not to let you change your mind about what WAL files exist in the fi= rst place. So I don't think this is a bug, but perhaps there is room for = improvement. =0AAt the least, I think we should log an explicit WARNING i= f the WAL stream ends before the specified PIT is reached. =0ANo one hi= des WAL files from the system deliberately. A few days of WAL files could= take up a lot of space. And they could come from different backup sets.= =0AIf you have a gap in your restored WAL-files and have specified date a= nd time further ahead, an warning and a pause should be issued.=0AWithout= the pause in recover the warning is of little use as the database is alr= eady opened for read and write.=0A=0A--=0ALeif ----=_RainLoop_322_651993250.1547272794 Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable
"= Jeff Janes" <j= eff.janes@gmail.com> skrev 11. januar 2019 kl. 15:03:
On Fri, Jan 11, 2019 at = 4:08 AM PG Bug reporting form <noreply@postgresql.org> wrote:

PostgreSQL should have paused recovery also on t= he first scenario. Then I
could have added missing wal and continued w= ith restore.
I agree with you that somethin= g here is not very user friendly. But the counter argument is that you sh= ould not be hiding WAL files from the system in the first place. Once it = is told that the file doesn't exist, it doesn't make sense to pause becau= se non-existence is usually permanent, so there is nothing to be done aft= er a pause. Or in other words, the pause feature is to let you change you= r mind about what time point you want to recover to (moving it only forwa= rd), not to let you change your mind about what WAL files exist in the fi= rst place. So I don't think this is a bug, but perhaps there is room for = improvement.
At the least, I think we should log a= n explicit WARNING if the WAL stream ends before the specified PIT is rea= ched.

No one hides WAL f= iles from the system deliberately. A few days of WAL files could take up = a lot of space. And they could come from different backup sets.
If you= have a gap in your restored WAL-files and have specified date and time f= urther ahead, an warning and a pause should be issued.
Without the pau= se in recover the warning is of little use as the database is already ope= ned for read and write.

--
Leif



----=_RainLoop_322_651993250.1547272794--