Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lP5hB-0008HG-0N for pgsql-hackers@arkaria.postgresql.org; Wed, 24 Mar 2021 15:45:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lP5h9-0001Bg-1e for pgsql-hackers@arkaria.postgresql.org; Wed, 24 Mar 2021 15:45:19 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lP5e5-0006f2-82 for pgsql-hackers@lists.postgresql.org; Wed, 24 Mar 2021 15:42:09 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lP5e1-0001pE-P4 for pgsql-hackers@lists.postgresql.org; Wed, 24 Mar 2021 15:42:08 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 12OFfwgk1099281; Wed, 24 Mar 2021 11:41:59 -0400 From: Tom Lane To: Andrew Dunstan cc: Justin Pryzby , Dilip Kumar , Robert Haas , Alvaro Herrera , Andres Freund , Tomas Vondra , Alexander Korotkov , David Steele , Ildus Kurbangaliev , Dmitry Dolgov <9erthalion6@gmail.com>, pgsql-hackers@lists.postgresql.org Subject: Re: [HACKERS] Custom compression methods In-reply-to: References: <20210319222242.GA23930@alvherre.pgsql> <4158590.1616185209@sss.pgh.pa.us> <20210320000625.GP11765@telsasoft.com> <20210320074420.GR11765@telsasoft.com> <20210320153933.GT11765@telsasoft.com> <229250.1616261775@sss.pgh.pa.us> <261449.1616267030@sss.pgh.pa.us> Comments: In-reply-to Andrew Dunstan message dated "Sat, 20 Mar 2021 16:37:51 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <1099279.1616600518.1@sss.pgh.pa.us> Content-Transfer-Encoding: 8bit Date: Wed, 24 Mar 2021 11:41:58 -0400 Message-ID: <1099280.1616600518@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Andrew Dunstan writes: > On 3/20/21 3:03 PM, Tom Lane wrote: >> I fixed up some issues in 0008/0009 (mostly cosmetic, except that >> you forgot a server version check in dumpToastCompression) and >> pushed that, so we can see if it makes crake happy. > It's still produced a significant amount more difference between the > dumps. For now I've increased the fuzz factor a bit like this: > -   if (   ($oversion ne $this_branch && $difflines < 2000) > +   if (   ($oversion ne $this_branch && $difflines < 2700) > I'll try to come up with something better. Maybe just ignore lines like > SET default_toast_compression = 'pglz'; > when taking the diff. I see that some other buildfarm animals besides your own critters are still failing the xversion tests, presumably because they lack this hack :-(. On reflection, though, I wonder if we've made pg_dump do the right thing anyway. There is a strong case to be made for the idea that when dumping from a pre-14 server, it should emit SET default_toast_compression = 'pglz'; rather than omitting any mention of the variable, which is what I made it do in aa25d1089. If we changed that, I think all these diffs would go away. Am I right in thinking that what's being compared here is new pg_dump's dump from old server versus new pg_dump's dump from new server? The "strong case" goes like this: initdb a v14 cluster, change default_toast_compression to lz4 in its postgresql.conf, then try to pg_upgrade from an old server. If the dump script doesn't set default_toast_compression = 'pglz' then the upgrade will do the wrong thing because all the tables will be recreated with a different behavior than they had before. IIUC, this wouldn't result in broken data, but it still seems to me to be undesirable. dump/restore ought to do its best to preserve the old DB state, unless you explicitly tell it --no-toast-compression or the like. regards, tom lane