Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eUF5x-0001E0-FR for pgsql-general@arkaria.postgresql.org; Wed, 27 Dec 2017 17:02:21 +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 1eUF5v-0002sd-KK for pgsql-general@arkaria.postgresql.org; Wed, 27 Dec 2017 17:02:19 +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 1eUF5v-0002sU-Cy for pgsql-general@lists.postgresql.org; Wed, 27 Dec 2017 17:02:19 +0000 Received: from tamriel.snowman.net ([96.255.250.162]) by magus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1eUF5r-00006W-IH for pgsql-general@lists.postgresql.org; Wed, 27 Dec 2017 17:02:18 +0000 Received: by tamriel.snowman.net (Postfix, from userid 1000) id A84955F795; Wed, 27 Dec 2017 12:02:13 -0500 (EST) Date: Wed, 27 Dec 2017 12:02:13 -0500 From: Stephen Frost To: Alvaro Herrera Cc: Edson Carlos Ericksson Richter , pgsql-general@lists.postgresql.org Subject: Re: Does PostgreSQL check database integrity at startup? Message-ID: <20171227170213.GW4628@tamriel.snowman.net> References: <20171227144951.GU4628@tamriel.snowman.net> <20171227164746.hnoqqxefp5abzjwz@alvherre.pgsql> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="M/Gl0xHZ1wi+ZsHO" Content-Disposition: inline In-Reply-To: <20171227164746.hnoqqxefp5abzjwz@alvherre.pgsql> User-Agent: Mutt/1.5.21 (2010-09-15) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --M/Gl0xHZ1wi+ZsHO Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Alvaro, * Alvaro Herrera (alvherre@2ndquadrant.com) wrote: > Stephen Frost wrote: >=20 > > * Edson Carlos Ericksson Richter (richter@simkorp.com.br) wrote: >=20 > > > Anyway, instead digging into rsync functionality (or bugs - I doubt, > > > but who knows?), I do prefer to have a script I can run to check if > > > there is obvious failures in standby servers. > >=20 > > As mentioned, zero-byte files can be perfectly valid. PostgreSQL does > > have page-level CRCs, if you initialized your database with them (which > > I would strongly recommend). >=20 > Page-level checksums would not detect the problem being complained in > this thread, however. It's entirely unclear to me what the problem being complained about in this thread actually is. The complaint so far was about zero-byte files, but those are entirely valid, so that isn't a problem that anyone can solve.. Given the thread subject, if someone actually wanted to do a database integrity check before startup, they could use pgBackRest to perform a backup with a CRC-enabled database and at least verify that all of the checksums are valid. We could possibly look into adding some set of additional checks for files which can't actually be zero-byte, perhaps.. I know we have some other one-off checks already. Thanks! Stephen --M/Gl0xHZ1wi+ZsHO Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCgAGBQJaQ9IVAAoJEO1sijiDR2RVT0QQAMNw0MW6qM7ggcIGNCvvWTvH b/GvSDwVwZGOIVYf8ZuN+UCNSnO1xcTN9iksoou5jFf5r/BeCp6zQlyipO0aHYwh 6KP/n9DpXqpjR/qEwcURcAxvo963ocYxv8SMdG+ArQb/Z9tRMprR1pF/+1UNuBk6 FJ8RANf8iWAjO+zXxCoskl6n8Jp5cT4VkUCqU5Z0WR2oEsaiChEyMI6z+GEdOyrz IiH/oeGGpFdUtUjXiSVjFIXi//KI8f1F1q3S24nuHMSrtwuiBUW7IneggRS329UR FOQfHxVDI7EtRFytI+By/Y/u0Ws9fL0aKX6L4jgyqyfSrdYAypgUpPcjQ4zQTTOl Pjo+IdARxpSX47wRcZ1HbXkghQKtP9dcvJsN1JGVu1LFSXT+4LtEhXl26aw9w8Qz czwFsSwVOgCJ+6Ge0l7CNuAReT2XIwno+5Niv2XwhJMC1UbGdGPNpbAE2TcKhVSF roN0b7t/UgpBFgl3LmMA5LgY1uBJ9rcriHcAB+SXI4B03RkrPVbDFrpq0VkKJriK qvBefyhVXffk9X3zcQvJ6UfZEE2MZ7EvnOAaxXfAzrJxq1gmYWgon2xiw06VEJ5g HtL2w10U3gDHpgyGFyVnxodH+0c/ch1LNWWcKZRGHU2VVoSuTZltuqHj9HKvauHt 2SbTl8jbvMyhyT3UXtgQ =CX4b -----END PGP SIGNATURE----- --M/Gl0xHZ1wi+ZsHO--