pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Stephen Frost <sfrost@snowman.net>
To: Alban Hertroys <haramrae@gmail.com>
Cc: Jan Wieck <jan@wi3ck.info>
Cc: Edson Carlos Ericksson Richter <richter@simkorp.com.br>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: Does PostgreSQL check database integrity at startup?
Date: Sat, 30 Dec 2017 10:27:16 -0500
Message-ID: <20171230152716.GH2416@tamriel.snowman.net> (raw)
In-Reply-To: <1B534695-9219-4555-B31E-92A73D390621@gmail.com>
References: <20171227215204.nucxo7b2ssmyznip@alvherre.pgsql>
	<20171228121651.GZ4628@tamriel.snowman.net>
	<42cda197-fead-a7e5-a7e2-750d98bc4eb2@simkorp.com.br>
	<743808611.5608368.1514484408822@mail.yahoo.com>
	<20171228182636.GG4628@tamriel.snowman.net>
	<CAGBW59fasv0KxRg6YTfQM7+zzmJ6jnwBvDGEiNi0aJH9HyqCzA@mail.gmail.com>
	<48a4bcfa-6b85-81ca-9b59-9e47af8fa5af@simkorp.com.br>
	<20171230011315.GC2416@tamriel.snowman.net>
	<CAGBW59eqjmsymYJUFO6q0Yya3G2AonSi-h0vUiUCYKYUsLLM_w@mail.gmail.com>
	<1B534695-9219-4555-B31E-92A73D390621@gmail.com>

Greetings Alban,

* Alban Hertroys (haramrae@gmail.com) wrote:
> In fact, I don't see it mentioned explicitly anywhere, but are we actually looking at a problem?

From the discussion in the google barman group, it's clear that the file
shouldn't be zero bytes in this specific case.

> I'm not convinced by the argument that a CRC check of a 0 byte file on a standby would not detect corruption. At the least, the CRC would be different or we would be left with a CRC on the master that we can't match any CRC's on the slave to if the file is larger on the master.

As discussed, files on the primary can be different at a byte level from
those on replicas and still be perfectly valid and correct, for a
variety of reasons from hint bit differences to differences due to the
replica not being at exactly the same point as the primary.

> If CRC's can be relied on to detect corruption (which they were designed to do), then that answers Edson's question.

The checksums included in PG are page-level and therefore there simply
isn't one to look at if the file is zero bytes.

Thanks!

Stephen

Attachments:

  signature.asc (application/pgp-signature, 818B) download

view thread (51+ messages)  latest in thread

Message-ID: <20171230152716.GH2416@tamriel.snowman.net>
Permalink:  ../20171230152716.GH2416@tamriel.snowman.net/
Also on:    postgresql.org/message-id/20171230152716.GH2416@tamriel.snowman.net

 · 

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-general@postgresql.org
  Cc: sfrost@snowman.net, haramrae@gmail.com, jan@wi3ck.info, richter@simkorp.com.br
  Subject: Re: Does PostgreSQL check database integrity at startup?
  In-Reply-To: <20171230152716.GH2416@tamriel.snowman.net>
  References: <20171227215204.nucxo7b2ssmyznip@alvherre.pgsql> <20171228121651.GZ4628@tamriel.snowman.net> <42cda197-fead-a7e5-a7e2-750d98bc4eb2@simkorp.com.br> <743808611.5608368.1514484408822@mail.yahoo.com> <20171228182636.GG4628@tamriel.snowman.net> <CAGBW59fasv0KxRg6YTfQM7+zzmJ6jnwBvDGEiNi0aJH9HyqCzA@mail.gmail.com> <48a4bcfa-6b85-81ca-9b59-9e47af8fa5af@simkorp.com.br> <20171230011315.GC2416@tamriel.snowman.net> <CAGBW59eqjmsymYJUFO6q0Yya3G2AonSi-h0vUiUCYKYUsLLM_w@mail.gmail.com> <1B534695-9219-4555-B31E-92A73D390621@gmail.com> <20171230152716.GH2416@tamriel.snowman.net>

* 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