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 1nWMxI-0006bB-PL for pgsql-hackers@arkaria.postgresql.org; Mon, 21 Mar 2022 18:40:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nWMxH-0003KK-Gl for pgsql-hackers@arkaria.postgresql.org; Mon, 21 Mar 2022 18:40:35 +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 1nWMxG-0003KA-Ej for pgsql-hackers@lists.postgresql.org; Mon, 21 Mar 2022 18:40:35 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nWMxB-0001bg-Bo for pgsql-hackers@lists.postgresql.org; Mon, 21 Mar 2022 18:40:33 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 503C25C01E5; Mon, 21 Mar 2022 14:40:26 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Mon, 21 Mar 2022 14:40:26 -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=CAq0NkoouSNvSY0LWxo/RiznwiXdhz+N/jz4RHbWK iI=; b=dNtut0HrnN6HufiE3+8TUtxUE+/dD+71tlQrIsJBjGC/7ZPPU+x5hE9PV vMqN7eeyfn0dRySyOZYdTHB+yhl/hP8Fwl2W39nxQUShjC8cWYpYvveAj1ysZM6D tMwBx3qnBE4kPTTLX1n25kjtB113e8VLuhxKFp88AqtKOIyfqq1/+xGfOSZdQO7K zln5PGwZuj+nhnfQl7kHhUz0D8cK24pYfW50nM7Iut4GBqenbF+9hQuk0IjX6uhq 9LD7vfVDfrbZ1SdpafedeEZO5/IYJLDqzEWIZGICoh/Gtv3t5W25av9OeQLy9pKt nE/vN1FwDX01eujxWC5LeQbwMF9yw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrudegfedgudduiecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefkffggfgfuvfhfhfgjtgfgsehtkeertddtfeejnecuhfhrohhmpefrvght vghrucfgihhsvghnthhrrghuthcuoehpvghtvghrrdgvihhsvghnthhrrghuthesvghnth gvrhhprhhishgvuggsrdgtohhmqeenucggtffrrghtthgvrhhnpeelgfetfeeitdelleeg geejvefhueetfedvtdejheevueeifeegvdfhueeludetueenucevlhhushhtvghrufhiii gvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehpvghtvghrrdgvihhsvghnthhrrghu thesvghnthgvrhhprhhishgvuggsrdgtohhm X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 21 Mar 2022 14:40:24 -0400 (EDT) Message-ID: <7d25a313-3f98-b6c2-1aa6-36d194a41c99@enterprisedb.com> Date: Mon, 21 Mar 2022 19:40:22 +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 , Pavel Borisov Cc: Aleksander Alekseev , Postgres hackers , Japin Li , Alexander Korotkov , Kyotaro Horiguchi , Ilya Anfimov References: <85f2c6c5-f8a6-5da8-67a6-9e48f56c7f77@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 18.03.22 16:14, Maxim Orlov wrote: > Here is v22. It addresses things mentioned by Tom and Kyotaro. Also > added Aleksander's changes from v21. The v22-0002-Update-XID-formatting-in-the-.po-files.patch is not necessary. That is done by a separate procedure. I'm wondering about things like this: - psprintf("xmax %u equals or exceeds next valid transaction ID %u:%u", - xmax, + psprintf("xmax %llu equals or exceeds next valid transaction ID %u:%llu", + (unsigned long long) xmax, EpochFromFullTransactionId(ctx->next_fxid), - XidFromFullTransactionId(ctx->next_fxid))); + (unsigned long long) XidFromFullTransactionId(ctx->next_fxid))); This %u:%u business is basically an existing workaround for the lack of 64-bit transaction identifiers. Presumably, when those are available, all of this will be replaced by a single number display, possibly a single %llu. So these sites you change here will have to be touched again, and so changing this now doesn't make sense. At least that's my guess. Maybe there needs to be a fuller explanation of how this is meant to be transitioned. As a more general point, I don't like plastering these bulky casts all over the place. Casts hide problems. For example, if we currently have elog(LOG, "xid is %u", xid); and then xid is changed to a 64-bit type, this will give a compiler warning until you change the format. If we add a (long long unsigned) cast here now and then somehow forget to change the type of xid, nothing will warn us about that. (Note that there is also third-party code affected by this.) Besides, these casts are quite ugly anyway, and I don't think the solution for all time should be that we have to add these casts just to print xids. I think there needs to be a bit more soul searching here on how to handle that in the future and how to transition it. I don't think targeting this patch for PG15 is useful at this point.