Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eVJ2g-0007uv-OJ for pgsql-general@arkaria.postgresql.org; Sat, 30 Dec 2017 15:27:22 +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 1eVJ2g-0001go-21 for pgsql-general@arkaria.postgresql.org; Sat, 30 Dec 2017 15:27:22 +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 1eVJ2f-0001gf-Qe for pgsql-general@lists.postgresql.org; Sat, 30 Dec 2017 15:27:21 +0000 Received: from tamriel.snowman.net ([96.255.250.162]) by magus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1eVJ2c-0001dh-Jf for pgsql-general@lists.postgresql.org; Sat, 30 Dec 2017 15:27:21 +0000 Received: by tamriel.snowman.net (Postfix, from userid 1000) id 651575F79C; Sat, 30 Dec 2017 10:27:16 -0500 (EST) Date: Sat, 30 Dec 2017 10:27:16 -0500 From: Stephen Frost To: Alban Hertroys Cc: Jan Wieck , Edson Carlos Ericksson Richter , pgsql-general@lists.postgresql.org Subject: Re: Does PostgreSQL check database integrity at startup? Message-ID: <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> <48a4bcfa-6b85-81ca-9b59-9e47af8fa5af@simkorp.com.br> <20171230011315.GC2416@tamriel.snowman.net> <1B534695-9219-4555-B31E-92A73D390621@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="Yia77v5a8fyVHJSl" Content-Disposition: inline In-Reply-To: <1B534695-9219-4555-B31E-92A73D390621@gmail.com> User-Agent: Mutt/1.5.24 (2015-08-30) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --Yia77v5a8fyVHJSl Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Greetings Alban, * Alban Hertroys (haramrae@gmail.com) wrote: > In fact, I don't see it mentioned explicitly anywhere, but are we actuall= y looking at a problem? =46rom 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 differe= nt 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 --Yia77v5a8fyVHJSl Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCgAGBQJaR7BUAAoJEO1sijiDR2RV89wP/2qQqRcz9RZnifKE64NhRmN7 Xx3bxNa4qVqMCCn0VRZUDXh6DIJCnyjCjCS4PtLoD4qb03RynoHseYPDE17Nnco8 d2kscjNUiOEOFdtxMFVa9WseHnN4dHhoXzrBYGdHG3spszzUKylGuuaQT+DdFYWN 3XQM9WNqyJjbEZqBiFFNKmclh2JDNITGwWn8Ins1HIdST6tsyI80RhkpO+CjA6si iSwmXg63cmf9d/wiDwtVHYNsYBfHy/YCWevCMwYpBP99DdJVHSBXk4MJfD6jNclx +mQUZt1gNZn1krjnNtrb8bRCtQ/ZZB5+9Dgmi2KCdr/d38WY6b6AEFrIkYzR+cAq 43HWCrF9WPkl6oJk1AoECTlk17wWmGJTuyAq/XP3Qirm9srJstITRp4cK045UMxa /BYT9aG8q6XHlQFUDauC4MpCm0FESTpwa5vV66KFMQ15LNosWwtlKCLtl23FbwLc viSv5DzLXZ3dobUnEO3gFcGP2rQpFmspyKr06yVAtkka9UwrN42QNyY3Ezz01EYK XNJZd5JwVoRwtl95PvKVnyLpj4zsOzRo4rs3oPtGs/oJQmw5eZEv3kwr12OFgZv4 HwxPaFKsWKdHoDBV6BxLTjfw4mgqXOkfV0xBaqtLW9vYpreSWvm64hJGXsA4QDtn /466yoR33pF9xg8JWitf =0BVs -----END PGP SIGNATURE----- --Yia77v5a8fyVHJSl--