Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ecWKE-0000IE-MF for pgsql-admin@arkaria.postgresql.org; Fri, 19 Jan 2018 13:03:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ecWKD-0004d9-Tm for pgsql-admin@arkaria.postgresql.org; Fri, 19 Jan 2018 13:03:17 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ecWKD-0004d0-IE for pgsql-admin@lists.postgresql.org; Fri, 19 Jan 2018 13:03:17 +0000 Received: from smtp-32-i5.italiaonline.it ([213.209.9.32] helo=libero.it) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1ecWK6-000280-5H for pgsql-admin@lists.postgresql.org; Fri, 19 Jan 2018 13:03:16 +0000 Received: from oxapps-13-076.iol.local ([10.101.8.86]) by smtp-32.iol.local with SMTP id cWK2ePNnW8BAzcWK2eEQ8r; Fri, 19 Jan 2018 14:03:06 +0100 x-libjamoibt: 1601 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virgilio.it; s=s2017; t=1516366986; bh=TB/FHJHxIoGvmVIHPXGdTFkDTAiTKskhF1QJg2bxKYo=; h=Date:From:To:Cc:In-Reply-To:References:Subject; b=WBJ1Bhbd1QbmlwMxxCgG4Ud+7FcZw0zyqu2AkNzoEmhG/GLdAV+wEAFAoFLL+AxFd U50yLzLf/YtW2q1oJy/SZk8K6lAOEhSIosBe4WCS2+Vu1o9OOQEqysysP6QLDJ1ofB GAUq54SHUJkbtWVF8OQ7lhagjpGzSvI2gjM5/v4PgUJOpM5FO6h8LBQTpNHa5lznJe z1srFgxnx1u2iPyUpbzk4RethDI5yYmkydGeCXZkZYG9tlBNEm5bsc9oo6lqQi2gN9 kOCQrb2wacwI67VmITVN6M+9JjAWdgEJgKgEjuB3BpCPEVxtuvUmjZ9z1BhNPz21/0 8xmhn1keuae/A== X-CNFS-Analysis: v=2.2 cv=a4xAzQaF c=1 sm=1 tr=0 a=3ctuitl+xpTLVlhGSp/YQg==:117 a=yzFRXalZF7QA:10 a=xJTDAyycAAAA:8 a=kPg10VR9AAAA:8 a=LAKjKTGo3p8i9U7gt3wA:9 a=QEXdDO2ut3YA:10 a=vptMTuGJMYguHMEck7gA:9 a=j5O-8a3oXy5yWphn:21 a=_W_S_7VecoQA:10 a=swXOJ3vSs_fEAyTCSpdh:22 a=pbkouhIAMd91kwdrYYoq:22 Date: Fri, 19 Jan 2018 14:03:05 +0100 (CET) From: flumbador@virgilio.it To: Alvaro Herrera Cc: pgsql-admin@lists.postgresql.org Message-ID: <1355160593.1572577.1516366986038@mail.virgilio.it> In-Reply-To: <20180112125206.gdwp3ulxc3pa6wdt@alvherre.pgsql> References: <326066541.973171.1515753625461@mail.virgilio.it> <20180112125206.gdwp3ulxc3pa6wdt@alvherre.pgsql> Subject: Re: Issue on restore / recover MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_1572576_1035591011.1516366986034" X-Priority: 3 Importance: Medium X-Mailer: Open-Xchange Mailer v7.8.3-Rev40 X-Originating-IP: 46.235.159.117 X-Originating-Client: open-xchange-appsuite x-libjamsun: sJgZTwy18ZfX7qLTzgEng7SWvpY3IhNr x-libjamv: k7bwtkP8WgI= X-CMAE-Envelope: MS4wfD2FkQDa6+iXt0gpJBKuYO9plu8c+V3nHZR1l+mdbQnC3nYiMF/g4QJ7SWf4fuPoBQcPDAwSU4ASH7u2DP1DBolBhdPw337+8nN9DDRMisSc9+uHJZ7A 3RWZLNwZrai5RMg3j66q/LUChb3Pc/JwIBflR2Oed6AQ1mEvoSG7o0tnvrhQUE9YRA7CgRhlCpEKox2qmbiaIrQWsCq4iFkU3HJN2sXsqcYBBgyd+NRpA0oI List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk ------=_Part_1572576_1035591011.1516366986034 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi I agree with You! The most important thing is that the backup is consistent and don't loose a= ny files. However my opinion is that postgresql should raise an error when= it find a missing file during recovery, and not try to initialize it with = empty pages .... Thanks to all for the support Best Regards Gabriele=20 Il 12 gennaio 2018 alle 13.52 Alvaro Herrera ha s= critto: >=20 > flumbador@virgilio.it wrote: >=20 > > >=20 > > I want to show that postgresql, while is recovering the databas= e > > 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. > >=20 > > >=20 > 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 creat= es > some files that are missing when recovery starts, so just checking "d= o > 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 poin= t > where consistent point is reached, but (secondly) that would be a ver= y > expensive way to check for a condition in the "should not happen" cam= p > (namely, that your backup tool is randomly losing files). >=20 > Maybe one thing that is happening is that if you lose a whole file, a= nd > 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 ef= fect. > If this is indeed what is happening, I have to say that it's not grea= t. > But again, with a working backup system you wouldn't have lost the fi= le > in the first place, so the case doesn't arise. >=20 > -- > =C3=81lvaro Herrera https://www.2ndQuadrant.com/ > PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services >=20 ------=_Part_1572576_1035591011.1516366986034 MIME-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

Hi

I agree with You!

The most important thing = is that the backup is consistent and don't loose any fil= es. However my opinion  is that postgresql should raise an e= rror when it find a missing file during recovery, and not try to initialize= it with empty pages ....

Thanks to all for the support

Best Re= gards

Gabriele 


Il 12 gennaio 2018 alle 13.52 A= lvaro Herrera <alvherre@alvh.no-ip.org> ha scritto:

=

flumbador@virgilio.it wrote:

I want to show that postg= resql, 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 re= covery that end successfully. I know
that the source of the problem is t= hat I have to guarantee that the
backup is complete and consistent but i= t sound me strange that
postgresql don't signal any errors when it c= an'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 ju= st don't check
for this. It seems a very difficult situation to chec= k for -- firstly
because, as you must have realized by now, the recovery= process creates
some files that are missing when recovery starts, so ju= st checking "do
all files exist" prior to starting recovery is n= ot the right thing to
check for. Maybe you could figure out a check to r= un just at the point
where consistent point is reached, but (secondly) t= hat would be a very
expensive way to check for a condition in the "s= hould not happen" camp
(namely, that your backup tool is randomly lo= sing 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 a= s 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&= #39;t have lost the file
in the first place, so the case doesn't ari= se.

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

=20 ------=_Part_1572576_1035591011.1516366986034--