pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: flumbador@virgilio.it
Cc: Rui DeSousa <rui.desousa@icloud.com>
Cc: pgsql-admin@lists.postgresql.org
Subject: Re: Issue on restore / recover
Date: Fri, 12 Jan 2018 09:52:06 -0300
Message-ID: <20180112125206.gdwp3ulxc3pa6wdt@alvherre.pgsql> (raw)
In-Reply-To: <326066541.973171.1515753625461@mail.virgilio.it>

flumbador@virgilio.it wrote:

> I want to show that postgresql, while is recovering the database
> applying the WAL file, don't raise any error if it can't find a
> missing file.  It continue the recovery that end successfully. I know
> that the source of the problem is that I have to guarantee that the
> backup is complete and consistent but it sound me strange that
> postgresql don't signal any errors when it can't find a file .... I
> hope that is clear the scope of the testcase.

It seems clear to me.  Our current answer is that we just don't check
for this.  It seems a very difficult situation to check for -- firstly
because, as you must have realized by now, the recovery process creates
some files that are missing when recovery starts, so just checking "do
all files exist" prior to starting recovery is not the right thing to
check for.  Maybe you could figure out a check to run just at the point
where consistent point is reached, but (secondly) that would be a very
expensive way to check for a condition in the "should not happen" camp
(namely, that your backup tool is randomly losing files).

Maybe one thing that is happening is that if you lose a whole file, and
later the recovery process fills page 2 with the correct tuples, then
page 0 and page 1 are initialized too to the empty state as a side effect.
If this is indeed what is happening, I have to say that it's not great.
But again, with a working backup system you wouldn't have lost the file
in the first place, so the case doesn't arise.

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services




view thread (11+ messages)  latest in thread

Message-ID: <20180112125206.gdwp3ulxc3pa6wdt@alvherre.pgsql>
Permalink:  ../20180112125206.gdwp3ulxc3pa6wdt@alvherre.pgsql/
Also on:    postgresql.org/message-id/20180112125206.gdwp3ulxc3pa6wdt@alvherre.pgsql

 · 

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-admin@postgresql.org
  Cc: alvherre@alvh.no-ip.org, flumbador@virgilio.it, rui.desousa@icloud.com, pgsql-admin@lists.postgresql.org
  Subject: Re: Issue on restore / recover
  In-Reply-To: <20180112125206.gdwp3ulxc3pa6wdt@alvherre.pgsql>

* 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