Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from ) id 1jHYJc-0007KB-EX for pgsql-hackers@arkaria.postgresql.org; Thu, 26 Mar 2020 19:37:20 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1jHYJb-0006sn-6J for pgsql-hackers@arkaria.postgresql.org; Thu, 26 Mar 2020 19:37: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_SHA1:256) (Exim 4.89) (envelope-from ) id 1jHYJa-0006sf-TP for pgsql-hackers@lists.postgresql.org; Thu, 26 Mar 2020 19:37:18 +0000 Received: from tamriel.snowman.net ([2001:470:e38f::11]) by magus.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jHYJT-0002Qc-P5 for pgsql-hackers@postgresql.org; Thu, 26 Mar 2020 19:37:18 +0000 Received: by tamriel.snowman.net (Postfix, from userid 1000) id BE9105F798; Thu, 26 Mar 2020 15:37:11 -0400 (EDT) Date: Thu, 26 Mar 2020 15:37:11 -0400 From: Stephen Frost To: Mark Dilger Cc: Robert Haas , Amit Kapila , Suraj Kharage , tushar , Rajkumar Raghuwanshi , Rushabh Lathia , Tels , David Steele , Andrew Dunstan , PostgreSQL Hackers , Jeevan Chalke , vignesh C Subject: Re: backup manifests Message-ID: <20200326193711.GX13712@tamriel.snowman.net> References: <20200323224217.GN13712@tamriel.snowman.net> <20200325133106.GS13712@tamriel.snowman.net> <20200325205433.GV13712@tamriel.snowman.net> <20200326163452.GW13712@tamriel.snowman.net> <8364D8D1-C045-43F9-B99C-3A8FAB84D6C0@enterprisedb.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="BjOm3tsK/2NdfZj2" Content-Disposition: inline In-Reply-To: <8364D8D1-C045-43F9-B99C-3A8FAB84D6C0@enterprisedb.com> User-Agent: Mutt/1.5.24 (2015-08-30) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --BjOm3tsK/2NdfZj2 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Greetings, * Mark Dilger (mark.dilger@enterprisedb.com) wrote: > > On Mar 26, 2020, at 9:34 AM, Stephen Frost wrote: > > I'm not actually argueing about which hash functions we should support, > > but rather what the default is and if crc32c, specifically, is actually > > a reasonable choice. Just because it's fast and we already had an > > implementation of it doesn't justify its use as the default. Given that > > it doesn't actually provide the check that is generally expected of > > CRC checksums (100% detection of single-bit errors) when the file size > > gets over 512MB makes me wonder if we should have it at all, yes, but it > > definitely makes me think it shouldn't be our default. >=20 > I don't understand your focus on the single-bit error issue. =20 Maybe I'm wrong, but my understanding was that detecting single-bit errors was one of the primary design goals of CRC and why people talk about CRCs of certain sizes having 'limits'- that's the size at which single-bit errors will no longer, necessarily, be picked up and therefore that's where the CRC of that size starts falling down on that goal. > If you are sending your backup across the wire, single bit errors during = transmission should already be detected as part of the networking protocol.= The real issue has to be detection of the kinds of errors or modification= s that are most likely to happen in practice. Which are those? People man= ually mucking with the files? Bugs in backup scripts? Corruption on the s= torage device? Truncated files? The more bits in the checksum (assuming a= well designed checksum algorithm), the more likely we are to detect accide= ntal modification, so it is no surprise if a 64-bit crc does better than 32= -bit crc. But that logic can be taken arbitrarily far. I don't see the co= nnection between, on the one hand, an analysis of single-bit error detectio= n against file size, and on the other hand, the verification of backups. We'd like something that does a good job at detecting any differences between when the file was copied off of the server and when the command is run- potentially weeks or months later. I would expect most issues to end up being storage-level corruption over time where the backup is stored, which could be single bit flips or whole pages getting zeroed or various other things. Files changing size probably is one of the less common things, but, sure, that too. That we could take this "arbitrarily far" is actually entirely fine- that's a good reason to have alternatives, which this patch does have, but that doesn't mean we should have a default that's not suitable for the files that we know we're going to be storing. Consider that we could have used a 16-bit CRC instead, but does that actually make sense? Ok, sure, maybe someone really wants something super fast- but should that be our default? If not, then what criteria should we use for the default? > From a support perspective, I think the much more important issue is maki= ng certain that checksums are turned on. A one in a billion chance of miss= ing an error seems pretty acceptable compared to the, let's say, one in two= chance that your customer didn't use checksums. Why are we even allowing = this to be turned off? Is there a usage case compelling that option? The argument is that adding checksums takes more time. I can understand that argument, though I don't really agree with it. Certainly a few percent really shouldn't be that big of an issue, and in many cases even a sha256 hash isn't going to have that dramatic of an impact on the actual overall time. Thanks, Stephen --BjOm3tsK/2NdfZj2 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCgAGBQJefQRnAAoJEO1sijiDR2RVvisP/0S3mFYU/+aSZtl5WvDSjNwz UiYYS/ge/O6/P8ViiEYnOfvsgWPg659tA+cuUIBivYePjoTm0fo5iV4EIIxDZzeE VbXb62sO9rcp0Ccjv1CpkDIizu+AEQvxCe35K2jePlTji6nj5ZlkrJZkiWv1HKZz Tb6M+Rz3feFdeYe4YiN7dcMHXu+eSsJiRy4OKz9cJAEq5qC/pv4e4fja1cpj/Bdi yxoS4foE+l1MtuSdiaDSp5xXRpUUyFCRXyunFWJ99C7DP9LrJuek0PAwA+nd80pz aBGAV2MNgQp2/EzJaDf0gL2DNc3Q1I24JivK3y5B74EyxnsvhnVNPfC58oZPTqKo /6u7g3TX6HWWCzgvf3xNKUSEpf0iuAdJqHmkr3GV2gBfSVuHxErYRQtuif9UtTuf HuExs/QTn5YwG48ZFJyQWIbdlshC9dgiwCi418twGg48w0es6CObMDmh3cGBcerB s0NyjI8ejD9koYN0g6SYluYsjC0xbBFuEYG4MOtq4ARm5rA7HTQPr+rCPRDdTnwf U7LEkjbh360qabJe3ZWNGksumL6h7o7oC77eekGIrbiqUMPbmaeNMLAfVGBB30mr tYNLuI89vZrQO56yCJgxMrkZ8kZStdKcR06gh1HoUwcXWIvEvxDq/0OhYhV5xvLo nhDncRINNGEpWOCHGS/y =FSot -----END PGP SIGNATURE----- --BjOm3tsK/2NdfZj2--