Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gDYwt-0005ny-Oe for pgsql-hackers@arkaria.postgresql.org; Fri, 19 Oct 2018 17:52:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gDYwr-0005Po-RK for pgsql-hackers@arkaria.postgresql.org; Fri, 19 Oct 2018 17:52:33 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gDYwr-0005Ph-GO for pgsql-hackers@lists.postgresql.org; Fri, 19 Oct 2018 17:52:33 +0000 Received: from tamriel.snowman.net ([96.255.250.162]) by makus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gDYwn-0004ew-IG for pgsql-hackers@postgresql.org; Fri, 19 Oct 2018 17:52:32 +0000 Received: by tamriel.snowman.net (Postfix, from userid 1000) id 741FA5F79C; Fri, 19 Oct 2018 13:52:28 -0400 (EDT) Date: Fri, 19 Oct 2018 13:52:28 -0400 From: Stephen Frost To: Andres Freund Cc: Michael Paquier , Andrew Dunstan , Tom Lane , Michael Banck , Postgres hackers , Daniel Gustafsson , Magnus Hagander Subject: Re: pgsql: Add TAP tests for pg_verify_checksums Message-ID: <20181019175228.GN4184@tamriel.snowman.net> References: <20181014224138.GA15473@paquier.xyz> <11414.1539615900@sss.pgh.pa.us> <20181016220900.GA2331@paquier.xyz> <61121849-19c2-ca27-a928-08aacc0f1105@2ndQuadrant.com> <20181019135009.GG2099@paquier.xyz> <20181019143659.GJ4184@tamriel.snowman.net> <20181019171747.4uithw2sjkt6msne@alap3.anarazel.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="G0/9n43IvMSBq7WK" Content-Disposition: inline In-Reply-To: <20181019171747.4uithw2sjkt6msne@alap3.anarazel.de> User-Agent: Mutt/1.5.24 (2015-08-30) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --G0/9n43IvMSBq7WK Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Greetings, * Andres Freund (andres@anarazel.de) wrote: > On 2018-10-19 10:36:59 -0400, Stephen Frost wrote: > > * Michael Paquier (michael@paquier.xyz) wrote: > > > On Wed, Oct 17, 2018 at 05:30:05PM -0400, Andrew Dunstan wrote: > > > > Fine by me. > > >=20 > > > Thanks. This is now committed after some tweaks to the comments, a b= it > > > earlier than I thought first. > >=20 > > I just saw this committed and I'm trying to figure out why we are > > creating yet-another-list when it comes to deciding what should be > > checksum'd and what shouldn't be. >=20 > I'm not sure it's fair to blame Michael here. He's picking up slack, > because the original authors of the tool didn't even bother to reply to > the issue for quite a while. pg_verify_checksum was obviously never > tested on windows, it just didn't have tests showing that. I wasn't really going for 'blame' here, just that we've now got two different methods for doing the same thing- and those will give different answers; presumably this issue impacts pg_basebackup too, since the logic there wasn't changed. > > I also categorically disagree with the notion that it's ok for > > extensions to dump files into our tablespace diretories or that we > > should try to work around random code dumping extra files in the > > directories which we maintain- it's not like this additional code will > > actually protect us from that, after all, and it's foolish to think we > > really could protect against that. >=20 > I'm unconvinced. There already are extensions doing so, and it's not > like we've given them any sort of reasonable alternative. You can't just > create relations in a "registered" / "supported" kinda way right now, so > uh, yea, extension gotta make do. And that has worked for many years. I don't agree that any of this is an argument for accepting random code writing into arbitrary places in the data directory or tablespace directories as being something which we support or which we write code to work-around. If this is a capability that extension authors need then I'm all for having a way for them to have that capability in a clearly defined and documented way- and one which we could actually write code to handle and work with. > Also, as made obvious here, it's pretty clear that there's platform > differences about which files exists and which don't, so it's not that a > blacklist approach automatically is more maintainable. Platform differences are certainly something we can manage and we have code in a few different places for doing exactly that. A platform difference is a heck of a lot more reasonable than trying to guess at what random code that we've never seen before has done and try to work around that. > And I fail to see why a blacklist is architecturally better. There's > plenty cases where we might want to create temporary files, > non-checksummed data or such that we'd need a teach a blacklist about, > but there's far fewer cases where add new checksummed files. Basically > never since checksums have been introduced. And if checksums were > introduced for something new, say slrus, we'd ceertainly use > pg_verify_checksum during development. In cases where we need something temporary, we're going to need to be prepared to clean those up and we had better make it very plain that they're temporary and easy to write code for. Anything we aren't prepared to blow away on a crash-restart should be checksum'd and in an ideal world, we'd be looking to reduce the blacklist to only those things which are temporary. Of course, we may need different code for calculating the checksum of different types of files, which moves it =66rom really being a 'blacklist' to a list of file-types and their associated checksum'ing mechansim. Thanks! Stephen --G0/9n43IvMSBq7WK Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCgAGBQJbyhncAAoJEO1sijiDR2RVDfAP/39x93XAKIH8BiuUcasp9xPG aAkLFw2+jwlrGRZJpRtDr1DBxDU0+nZbASbzuWD/GGjiSUq/GGCvN6Pbvytv8qHN ZGLstbB3AXkmqzRgojgB/mclo2cA/GxleHcPxhLkCtTCYJxw99fxkZfphdKUWqHw aRC/BZw35+fwxkqEi3qVjobXEtvBunC32YlGG01GF4AV0j9MlOcB17MBo5Mwv2Yj Z4IPzhP8cCDe3lZsSGO2H2vOcj+SAVdP+GPNKxEyufQAN06FhROmmIkeVf2lScrW fbfUY63ByzpVd1eua+VHtV7qxi1TEF9oMo5OGE4o3foH7BFpaHtIsMLwSyktXXb5 IsgcGSL3ahOUK7LxO+YHC53V5aoF0bCJB5pjpVC7qfunyHe4B0ta5fe7DozXFQFk ks39L6DAONb7SKkv0oW/VTSKESBCeHUmo2pxwpQyBJcCa5nu0Z0HbmUl81uHhBLf YpvUnY6Hl4BJGWdRvPvEASnSnN7wMHQ+W4NirfCzWK/DSgHFSPm2HBVnCOQsXFeS k68cvRFYtdfz4hFi4HAuFL3EsKbXfPgAMnTi+Fqft157FcBSGXhTd/gpsBYY6ByV xYE/xkjD1hws2hTJNoOiYP5VbS4eIXL6aNJ24eaJdg0RHB2uG/kUkat3yK8OhFvu ugvwjkJy5kZtPv7m5TRd =nrLY -----END PGP SIGNATURE----- --G0/9n43IvMSBq7WK--