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 1oH5vI-00057s-JR for pgsql-hackers@arkaria.postgresql.org; Thu, 28 Jul 2022 15:59:40 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oH5vH-0001IH-EI for pgsql-hackers@arkaria.postgresql.org; Thu, 28 Jul 2022 15:59:39 +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 1oH5vH-0001I8-4M for pgsql-hackers@lists.postgresql.org; Thu, 28 Jul 2022 15:59:39 +0000 Received: from wout3-smtp.messagingengine.com ([64.147.123.19]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oH5vE-0005LR-I0 for pgsql-hackers@postgresql.org; Thu, 28 Jul 2022 15:59:38 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id A2F5A3200907; Thu, 28 Jul 2022 11:59:34 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Thu, 28 Jul 2022 11:59:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:reply-to:sender :subject:subject:to:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; t=1659023974; x=1659110374; bh=v tsVvDnQJ5TJDcZc/X7kEvzIbmKIDWnP7HeykR8kklo=; b=Fzl2xq0YV32zsXH8g jiNbkDI6KfNm/1R8fBw+bbkBHD2GeXogbTYdEvONRbbtYFZdYyn45BegQn+8/bq0 OjroAbhAt22coYx3pjvnlusEyrVUYhRmSJtgnCaKQ4apGKPoDjzEjOtRoyZ8gyb0 f/lNEzrFhs/Ei1mofGu8Kkuw84SuHnv9e6hgxqadyKDQGNhqk12+x/TPwbbyhW4F LFg+kchxY94NObYuZNxWGrIg33PdApLHzSxI8Mjk7qGCbqB77O3BlsR0QTTXvRdu TfTTyQvrqQdnsl8v0xiwsBOzMw5xucthLPRDPdacLUkfAHyPxSiCqXutWTxqHyOh eEbHw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrvdduhedgfeegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkgggtugfgjgesthekredttddtjeenucfhrhhomheptehlvhgr rhhoucfjvghrrhgvrhgruceorghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh eqnecuggftrfgrthhtvghrnhepvdektdffudfftdffffehfffhjeejhffgieeuueekjeek fffgudffhfduffffueevnecuffhomhgrihhnpegvnhhtvghrphhrihhsvggusgdrtghomh enucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrlhhv hhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhg X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 28 Jul 2022 11:59:32 -0400 (EDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 82551373; Thu, 28 Jul 2022 17:59:11 +0200 (CEST) Date: Thu, 28 Jul 2022 17:59:11 +0200 From: Alvaro Herrera To: Dilip Kumar Cc: Robert Haas , Andres Freund , Heikki Linnakangas , Thomas Munro , pgsql-hackers , vignesh C Subject: Re: making relfilenodes 56 bits Message-ID: <20220728155911.wlci3sovhmtrubrk@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Not a full review, just a quick skim of 0003. On 2022-Jul-28, Dilip Kumar wrote: > + if (!shutdown) > + { > + if (ShmemVariableCache->loggedRelFileNumber < checkPoint.nextRelFileNumber) > + elog(ERROR, "nextRelFileNumber can not go backward from " INT64_FORMAT "to" INT64_FORMAT, > + checkPoint.nextRelFileNumber, ShmemVariableCache->loggedRelFileNumber); > + > + checkPoint.nextRelFileNumber = ShmemVariableCache->loggedRelFileNumber; > + } Please don't do this; rather use %llu and cast to (long long). Otherwise the string becomes mangled for translation. I think there are many uses of this sort of pattern in strings, but not all of them are translatable so maybe we don't care -- for example contrib doesn't have translations. And the rmgrdesc routines don't translate either, so we probably don't care about it there; and nothing that uses elog either. But this one in particular I think should be an ereport, not an elog. There are several other ereports in various places of the patch also. > @@ -2378,7 +2378,7 @@ verifyBackupPageConsistency(XLogReaderState *record) > if (memcmp(replay_image_masked, primary_image_masked, BLCKSZ) != 0) > { > elog(FATAL, > - "inconsistent page found, rel %u/%u/%u, forknum %u, blkno %u", > + "inconsistent page found, rel %u/%u/" INT64_FORMAT ", forknum %u, blkno %u", > rlocator.spcOid, rlocator.dbOid, rlocator.relNumber, > forknum, blkno); Should this one be an ereport, and thus you do need to change it to that and handle it like that? > + if (xlrec->rlocator.relNumber > ShmemVariableCache->nextRelFileNumber) > + elog(ERROR, "unexpected relnumber " INT64_FORMAT "that is bigger than nextRelFileNumber " INT64_FORMAT, > + xlrec->rlocator.relNumber, ShmemVariableCache->nextRelFileNumber); You missed one whitespace here after the INT64_FORMAT. > diff --git a/src/bin/pg_controldata/pg_controldata.c b/src/bin/pg_controldata/pg_controldata.c > index c390ec5..f727078 100644 > --- a/src/bin/pg_controldata/pg_controldata.c > +++ b/src/bin/pg_controldata/pg_controldata.c > @@ -250,6 +250,8 @@ main(int argc, char *argv[]) > printf(_("Latest checkpoint's NextXID: %u:%u\n"), > EpochFromFullTransactionId(ControlFile->checkPointCopy.nextXid), > XidFromFullTransactionId(ControlFile->checkPointCopy.nextXid)); > + printf(_("Latest checkpoint's NextRelFileNumber: " INT64_FORMAT "\n"), > + ControlFile->checkPointCopy.nextRelFileNumber); This one must definitely be translatable. > /* Characters to allow for an RelFileNumber in a relation path */ > -#define RELNUMBERCHARS OIDCHARS /* same as OIDCHARS */ > +#define RELNUMBERCHARS 20 /* max chars printed by %lu */ Maybe say %llu here instead. I do wonder why do we keep relfilenodes limited to decimal digits. Why not use hex digits? Then we know the limit is 14 chars, as in 0x00FFFFFFFFFFFFFF in the MAX_RELFILENUMBER definition. -- Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/ "Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end." (2nd Commandment for C programmers)