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 1gDbpu-0005Nf-F6 for pgsql-hackers@arkaria.postgresql.org; Fri, 19 Oct 2018 20:57:34 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gDbps-00078G-RY for pgsql-hackers@arkaria.postgresql.org; Fri, 19 Oct 2018 20:57:32 +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 1gDbps-000789-Gr for pgsql-hackers@lists.postgresql.org; Fri, 19 Oct 2018 20:57:32 +0000 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gDbpp-0000Hg-Rw for pgsql-hackers@postgresql.org; Fri, 19 Oct 2018 20:57:31 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id 44E1AC0E; Fri, 19 Oct 2018 16:57:27 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Fri, 19 Oct 2018 16:57:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm2; bh=cl+dSsDG8Lr8ZVxs3wXDrmHAwz2 MHMaeYBqyenF9RCc=; b=P4LhaKXHqzW0CwUY3e9KDZVGqLeqbNw5RmCiN326Uzy NXHTyVZe65V8VHgM6OEamr9aXIB0JvHVKycyy5GSa3vZYb1MzZIJ2lDtntE7PMiU CTjg2fI1R/OX7J6fFSqfj8CFC1SZx7BggNgYgsKJlAkyUEOVhm7IO6aNBvW9zdvO scsjauXYINIy/yRfAmGaAlLH6mjgVjnvhX5OXyT0i5vVv4Cf9OGS1Kou2jJ67mpQ MGPiUTu+R3YKxmwTmtzHKdwVKRQnp8oKnxgfPBf3HpQztzVV1LKXgcgJvQ3RUm8M IWQ18DkjeNNPzTaSOetu+yobNHJJgA56l4ONcft8cZg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=cl+dSs DG8Lr8ZVxs3wXDrmHAwz2MHMaeYBqyenF9RCc=; b=bS3iVKskv/rRyvzla8Q8nM mCOSEA+Mv8BGgIsXHwIJNdSiqfvI84vVsUAeRp/iD/qkEmmcwWu2Sue17SVdCWx3 qD8f03hqHDKjarvK2/KTG5Ns5YPzX48+6TA3mVfg2+8L9SX54aIpBqotuXnwI/w7 zqLp2xAdUN5Wf/ppZQBMH+nSXcgny1VBm5R7gjz/koW1BOcJ/UoVkXFqqZGE7sv2 HerCdOZpLhD4+JqRPYwbf1h//k8p08VLWMuaMe0Ilb7Ydtemum84GOb0MqANqdDY qWg8A0shRcw6AEmDU9ExSbScI0MyX6rqaecDtbU/B63jl1Qgm1uFlCAH26DlE50Q == X-ME-Sender: X-ME-Proxy: Received: from intern.anarazel.de (c-98-210-140-171.hsd1.ca.comcast.net [98.210.140.171]) by mail.messagingengine.com (Postfix) with ESMTPA id B104EE4071; Fri, 19 Oct 2018 16:57:25 -0400 (EDT) Date: Fri, 19 Oct 2018 13:57:24 -0700 From: Andres Freund To: Stephen Frost 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: <20181019205724.ewnuhvrsanacihzq@alap3.anarazel.de> References: <20181019171747.4uithw2sjkt6msne@alap3.anarazel.de> <20181019175228.GN4184@tamriel.snowman.net> <20181019175908.kc67mfxdlguckask@alap3.anarazel.de> <20181019181103.GO4184@tamriel.snowman.net> <20181019183050.6fgqc5ugnavfzae4@alap3.anarazel.de> <20181019184751.GP4184@tamriel.snowman.net> <20181019192146.j4my7yjzv4eitw2w@alap3.anarazel.de> <20181019195728.GQ4184@tamriel.snowman.net> <20181019200723.4byzaw5km5jvsxlc@alap3.anarazel.de> <20181019203546.GR4184@tamriel.snowman.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181019203546.GR4184@tamriel.snowman.net> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi, On 2018-10-19 16:35:46 -0400, Stephen Frost wrote: > The only justification for *not* doing this is that some extension > author might have dumped files into our tablespace directory, something > we've never claimed to support nor generally worried about in all the > time that I can recall before this. No, it's really not the only reason. As I said, testing is much less likely to find cases where we're checksumming a short-lived file even though we shouldn't, than making sure that checksummed files are actually checksummed. > > > Playing this further and assuming that extensions dropping files into > > > tablespace directories is acceptable, what are we supposed to do when > > > there's some direct conflict between a file that we want to create in a > > > PG tablespace directory and a file that some extension dropped there? > > > Create yet another subdirectory which we call > > > "THIS_IS_REALLY_ONLY_FOR_PG"? > > > > Then it's a buggy extension. And we error out. > > Extensions writing into directories they shouldn't be makes them buggy > even if the core code isn't likely to write to a particular filename, > imv. I'll just stop talking to you about this for now. > > > What about two different extensions wanting to create files with the > > > same names in the tablespace directories..? > > > > > > Experimentation is fine, of course, this is open source code and people > > > should feel free to play with it, but we are not obligated to avoid > > > breaking things when an extension author, through their experimentation, > > > does something which is clearly not supported, like dropping files into > > > PG's tablespace directories. Further, when it comes to our user's data, > > > we should be taking a strict approach and accounting for everything, > > > something that this whitelist-of-patterns-based approach to finding > > > files to verify the checksums on doesn't do. > > > > It's not economically feasible to work on extensions that will only be > > usable a year down the road. > > I listed out multiple other solutions to this problem which you > summarily ignored. Except that none of them really achieves the goals you can achieve by having the files in the database (like DROP DATABASE working, for starters). > It's unfortunate that those other solutions weren't used and that, > instead, this extension decided to drop files into PG's tablespace > directories, but that doesn't mean we should condone or implicitly > support that action. This just seems pointlessly rigid. Our extension related APIs aren't generally very good or well documented. Most non-trivial extensions that add interesting things to the postgres ecosystem are going to need a few not so pretty things to get going. > I stand by my position that this patch should be reverted (with no > offense or ill-will towards Michael, of course, I certainly appreciate > his efforts to address the issues with pg_verify_checksums) and that we > should move more of this code to identify files to verify the checksums > on into libpgcommon and then use it from both pg_basebackup and > pg_verify_checksums, to the extent possible, but that we make sure to > account for all of the files in our tablespace and database directories. What does that do, except break things that currently work? Sure, work on a patch that fixes the architectural concerns, but what's the point in reverting it until that's done? > To the extent that this is an issue for extension authors, perhaps it > would encourage them to work with us to have supported mechanisms > instead of using hacks like dropping files into our tablespace > directories and such instead of using another approach to manage files > across multiple filesystems. I'd be kind of surprised if they really > had an issue doing that and hopefully everyone would feel better about > what these extensions are doing once they start using a mechanism that > we actually support. Haribabu has a patch, but it's on-top of pluggable storage, so not exactly a small prerequisite. Greetings, Andres Freund