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 1nX9Xn-00063H-SB for pgsql-hackers@arkaria.postgresql.org; Wed, 23 Mar 2022 22:33:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nX9Xm-0005Km-OX for pgsql-hackers@arkaria.postgresql.org; Wed, 23 Mar 2022 22:33:30 +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 1nX9Xl-0005Kd-Pu for pgsql-hackers@lists.postgresql.org; Wed, 23 Mar 2022 22:33:30 +0000 Received: from wout4-smtp.messagingengine.com ([64.147.123.20]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nX9Xi-0006Sk-63 for pgsql-hackers@lists.postgresql.org; Wed, 23 Mar 2022 22:33:28 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id BDBB93201C39; Wed, 23 Mar 2022 18:33:23 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Wed, 23 Mar 2022 18:33:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=RZYqwdesOBDvrmLsATM8sZDtD1cI5hv2jR9Iq4YaV WY=; b=kMeu4jaNz5yxrLgENYwq3cJ5ujbLgkmIDvdB+nnLYVaHiOo5taxCuy/KF 8ZKv7eNYumMg+eDIfDKiVzTnUJL/ZMqlbh0a1bvkTrdqv62JxRRDEdus8fae6iQd rjWeD7X1AGyeAzEs8/47aCG0jFuFBDcqpBrJ4yKrX+QXBfJdf5TdZ1kDefP65vX8 TXZeUzTWSo0FrIh/QFwuZbhLKbNhDy/htzuCXOc67mR9XOsIAVj6ShJ1WPGJXkvP s3GmvYlp2O4muQeu7NFeNnsmabjtJoVdqeH5iOgb87556Q/VVpYWD3wjpRFu3z7+ m7DCeshwb4+2c0X/ljszkIx+ADeCg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrudegkecutefuodetggdotefrodftvfcurf hrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjug hrpefkffggfgfuvfhfhfgjtgfgsehtkeertddtfeejnecuhfhrohhmpefrvghtvghrucfg ihhsvghnthhrrghuthcuoehpvghtvghrrdgvihhsvghnthhrrghuthesvghnthgvrhhprh hishgvuggsrdgtohhmqeenucggtffrrghtthgvrhhnpeefueelffduffffleevheelkeel vdehueffkeeigefhtedtveekfeejudfggfeugeenucffohhmrghinhepghhnuhdrohhrgh enucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehpvght vghrrdgvihhsvghnthhrrghuthesvghnthgvrhhprhhishgvuggsrdgtohhm X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 23 Mar 2022 18:33:21 -0400 (EDT) Message-ID: <131006ee-d309-f77e-7d3e-db8e9d76aeef@enterprisedb.com> Date: Wed, 23 Mar 2022 23:33:20 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: XID formatting and SLRU refactorings (was: Add 64-bit XIDs into PostgreSQL 15) Content-Language: en-US To: Maxim Orlov , Japin Li Cc: Aleksander Alekseev , Postgres hackers , Pavel Borisov , Alexander Korotkov , Kyotaro Horiguchi , Ilya Anfimov References: <7d25a313-3f98-b6c2-1aa6-36d194a41c99@enterprisedb.com> From: Peter Eisentraut In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 23.03.22 10:51, Maxim Orlov wrote: > Thanks for updating the patchs. I have a little comment on 0002. > > +                                errmsg_internal("found xmax %llu" " > (infomask 0x%04x) not frozen, not multi, not normal", > + > (unsigned long long) xid, tuple->t_infomask))); > > > Thanks for your review! Fixed. About v25-0001-Use-unsigned-64-bit-numbering-of-SLRU-pages.patch: -static bool CLOGPagePrecedes(int page1, int page2); +static bool CLOGPagePrecedes(uint64 page1, uint64 page2); You are changing the API from signed to unsigned. Is this intentional? It is not explained anywhere. Are we sure that nothing uses, for example, negative values as error markers? #define SlruFileName(ctl, path, seg) \ - snprintf(path, MAXPGPATH, "%s/%04X", (ctl)->Dir, seg) + snprintf(path, MAXPGPATH, "%s/%04X%08X", (ctl)->Dir, \ + (uint32) ((seg) >> 32), (uint32) ((seg) & (uint64)0xFFFFFFFF)) What's going on here? Some explanation? Why not use something like %llX or whatever you need? + uint64 segno = pageno / SLRU_PAGES_PER_SEGMENT; + uint64 rpageno = pageno % SLRU_PAGES_PER_SEGMENT; [etc.] Not clear whether segno etc. need to be changed to 64 bits, or whether an increase of SLRU_PAGES_PER_SEGMENT should also be considered. - if ((len == 4 || len == 5 || len == 6) && + if ((len == 12 || len == 13 || len == 14) && This was horrible before, but maybe we can take this opportunity now to add a comment? - SlruFileName(ctl, path, ftag->segno); + SlruFileName(ctl, path, (uint64) ftag->segno); Maybe ftag->segno should be changed to 64 bits as well? Not clear. There is a code comment at the definition of SLRU_PAGES_PER_SEGMENT that has some detailed explanations of how the SLRU numbering, SLRU file names, and transaction IDs tie together. This doesn't seem to apply anymore after this change. The reference page of pg_resetwal contains various pieces of information of how to map SLRU files back to transaction IDs. Please check if that is still all up to date. About v25-0002-Use-64-bit-format-to-output-XIDs.patch: I don't see the point of applying this now. It doesn't make PG15 any better. It's just a patch part of which we might need later. Especially the issue of how we are handwaving past the epoch-enabled output sites disturbs me. At least those should be omitted from this patch, since this patch makes these more wrong, not more right for the future. An alternative we might want to consider is that we use PRId64 as explained here: . We'd have to check whether we still support any non-GNU gettext implementations and to what extent they support this. But I think it's something to think about if we are going to embark on a journey of much more int64 printf output.