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 1oRfZY-0003P8-Lx for pgsql-hackers@arkaria.postgresql.org; Fri, 26 Aug 2022 20:04:56 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oRfZX-0002mK-H8 for pgsql-hackers@arkaria.postgresql.org; Fri, 26 Aug 2022 20:04:55 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oRfZX-0002mB-4k for pgsql-hackers@lists.postgresql.org; Fri, 26 Aug 2022 20:04:55 +0000 Received: from mail-io1-xd2c.google.com ([2607:f8b0:4864:20::d2c]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1oRfZR-0002s2-Be for pgsql-hackers@postgresql.org; Fri, 26 Aug 2022 20:04:53 +0000 Received: by mail-io1-xd2c.google.com with SMTP id 10so2027109iou.2 for ; Fri, 26 Aug 2022 13:04:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20210112.gappssmtp.com; s=20210112; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:from:to:cc; bh=vIM5r9o5SrFlKXm7u6f5dp22IGJXPAr47X709M7Zcug=; b=bUmUl/atSBxvXsWL0r7i37cEinmf5OB+n4YN8OwpLadEqTtdFtWFm71OtF2imPg3eA GKROuv+fjqkSWn8fqie4b1ofrs9clPfdtliIAdXYSZKD3tLs2IXvZftpns2lOeIgfBlB LUqK4p8D2qDHV0OGLIXt0vC5p7iGLxQ94kS/gs7nMy6/dakDkazUQXv5FNcrKAlLRM/x JI5ILyJWbzHC6AgPBjYvLqgHsi2x2tGtNDXIqcPrr+ktWC6v6dRV4NQ2DcxXC7r2lceR sh1FNYr3/GUo3WbtO83O1QLnTBfeakNVIvhbegQeMNIYBhYftjMfvla6gpm1xJnWDP6K 7iiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc; bh=vIM5r9o5SrFlKXm7u6f5dp22IGJXPAr47X709M7Zcug=; b=JGAkzBl5fC4ayCRINorfv4Hr2I8/rhekwQsVv6H2xgC4c6zj0azxoj9MJyEB+05mzN OVNr7YDQBgsfcCvbDwudQXhhwXGI0QkyGsWkh0F9r7Bgkqo1riurYgpB9xe9l6um8jSa s4t3k0RHrnHwGBcWyogT/WrFbCr1odYW5xpCteilOgCNpN7bNZxP4grjP3+xn6yBx+rZ vTGgxdQ+xd2zmSx8tYjYWjG5iS6r1fzbss7U7bBa1Nh8OY+HBQIz1nXoqCTnT4xJHMu4 R3g+8oRZzapcFubNeeYiksA/24D8g1XNHFRQW2g5wjkJd8tYGChrdWvO7G2osmWgOfiW iENw== X-Gm-Message-State: ACgBeo3faEcM5EDAbCMFbBIhKVPkjhylu3xvI3FQh1jApni/n/wnuxJ3 czkNWXK5Pxeui6zmFQsNUTFCLQ== X-Google-Smtp-Source: AA6agR7iGY/NnZL9WVaWD0s7z2V6QKWtPM7NLEkUIyvxCv4Sio/NfrVQyXSLLV2lq0K0JRD51OyY9w== X-Received: by 2002:a05:6638:ed1:b0:349:ce2b:3f4 with SMTP id q17-20020a0566380ed100b00349ce2b03f4mr4716574jas.155.1661544288078; Fri, 26 Aug 2022 13:04:48 -0700 (PDT) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id p15-20020a056638216f00b0034925115fb8sm1226764jak.159.2022.08.26.13.04.47 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 26 Aug 2022 13:04:47 -0700 (PDT) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id 63089800B78; Fri, 26 Aug 2022 15:04:46 -0500 (CDT) Date: Fri, 26 Aug 2022 15:04:46 -0500 From: Justin Pryzby To: Bruce Momjian Cc: "Finnerty, Jim" , Stephen Frost , Maxim Orlov , pgsql-hackers@postgresql.org, Magnus Hagander , Michael Paquier Subject: Re: Add 64-bit XIDs into PostgreSQL 15 Message-ID: <20220826200446.GK2342@telsasoft.com> References: <20220104193220.GL15820@tamriel.snowman.net> <20220106001226.GS14051@telsasoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220106001226.GS14051@telsasoft.com> User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, Jan 05, 2022 at 06:12:26PM -0600, Justin Pryzby wrote: > On Wed, Jan 05, 2022 at 06:51:37PM -0500, Bruce Momjian wrote: > > On Tue, Jan 4, 2022 at 10:22:50PM +0000, Finnerty, Jim wrote: > > > I'm concerned about the maintainability impact of having 2 new > > > on-disk page formats. It's already complex enough with XIDs and > > > multixact-XIDs. > > > > > > If the lack of space for the two epochs in the special data area is > > > a problem only in an upgrade scenario, why not resolve the problem > > > before completing the upgrade process like a kind of post-process > > > pg_repack operation that converts all "double xmax" pages to > > > the "double-epoch" page format? i.e. maybe the "double xmax" > > > representation is needed as an intermediate representation during > > > upgrade, but after upgrade completes successfully there are no pages > > > with the "double-xmax" representation. This would eliminate a whole > > > class of coding errors and would make the code dealing with 64-bit > > > XIDs simpler and more maintainable. > > > > Well, yes, we could do this, and it would avoid the complexity of having > > to support two XID representations, but we would need to accept that > > fast pg_upgrade would be impossible in such cases, since every page > > would need to be checked and potentially updated. > > > > You might try to do this while the server is first started and running > > queries, but I think we found out from the online checkpoint patch that > > I think you meant the online checksum patch. Which this reminded me of, too. I wondered whether anyone had considered using relation forks to maintain state of these long, transitional processes. Either a whole new fork, or additional bits in the visibility map, which has page-level bits. There'd still need to be a flag somewhere indicating whether checksums/xid64s/etc were enabled cluster-wide. The VM/fork bits would need to be checked while the cluster was being re-processed online. This would add some overhead. After the cluster had reached its target state, the flag could be set, and the VM bits would no longer need to be checked. -- Justin