Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wzV3X-0043D9-2V for pgsql-hackers@arkaria.postgresql.org; Thu, 27 Aug 2026 08:01:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wzV3V-000frG-1z for pgsql-hackers@arkaria.postgresql.org; Thu, 27 Aug 2026 08:01:49 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wzV3V-000fr8-0i for pgsql-hackers@lists.postgresql.org; Thu, 27 Aug 2026 08:01:49 +0000 Received: from lahtoruutu.iki.fi ([2a0b:5c81:1c1::37]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wzV3S-00000001Vnn-1kEj for pgsql-hackers@postgresql.org; Thu, 27 Aug 2026 08:01:48 +0000 Received: from [10.0.2.15] (unknown [75.125.238.37]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange x25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: hlinnaka) by lahtoruutu.iki.fi (Postfix) with ESMTPSA id 4hVv9c6y7Wz49Q0Y; Thu, 27 Aug 2026 11:01:40 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1787817701; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=HzJdghJS0Z+e6bwgsjG0USZ/+ze0zG3Po9wjojWX9kc=; b=CCWvJKkg6aYmm/IsGaz4cpmZN4v5oYe8amuME9bw0PsFMBbSEtWgV6ntO6i2IUSHh/NKcj U/GT+qVGR2bn0aK4zCKI4mbJrwaTLF0izLL6ZE9yWsD+xMlXZd5AAh/DvLwsa2ZCfTU9Kh I4U9wObS7e5M89+IAwrui8Orv2wXQTFa1XAotQMp9JtT+WjSEVmdCiHWzFuDOpK/7FM5HG pohQlavm+INDHSwZzPb5irq9TvyFDBKVLk3nrvePnJmNyMLjhGLTZhCUdGn6By4PgwiF1f Wjo6pOE1msWX/gVVE6HKiI0UBS4OESAXucQdRVaq+eGcaTX9UWDno5qvwbtu/g== ARC-Seal: i=1; a=rsa-sha256; d=iki.fi; s=lahtoruutu; cv=none; t=1787817701; b=Ry8Aif0lNtC+2ktV4XxkO5G8Bf/Irm2FlUBs7W9Uzcv350r0shE5zMftIdU/rVnJhfDzVP HGKVW4lBFfZLcADziLp90UZJxH493veaNufqV7eAJouUr7NZpcoSWgS5AGEzYfDW1Mk12w 0CrBXUd9yQ3JKnLpg28B++sf7meJVTf6TwBNOGEJJlMe4e4xqt2v2j0E723XA8EX8B4isN QDbr0wxhz7A0Uakjp4qTEAdmusFHZTb8rHojBiZ1N36gmCCBnPJFRYo5mX4cKvS8NDc+lX HCA4EaMYZ6MIMJPiklz36YJPduDXfkQHXKOC293p5pb0Nn1/e1HxVTG4bWMwJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1787817701; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=HzJdghJS0Z+e6bwgsjG0USZ/+ze0zG3Po9wjojWX9kc=; b=ZsN/ksQyJkfn1QhgKwJEMLggW3koZpUlpJeBPQc1j7cCIPysDAM8eu3LMo4IAxAZIReD54 JODmy0S8Ne0lRnjDU7GzVjnxDgqN3UDXQKg6tL6KFXovlpBPloCuNVCAOftOegsSNI/4FP WM6S+4OFFEacpAaSNvoTDotuLuATeytrbqOdlgj/HIu4sph7MSh4eZt8ldTx05BiMPVd54 zyzBKM9yaPFGHkAP5phEoHnikd4VY9ng856tlFpjaP83rRZBjbr94sEkAgeLnF9scV8UGo LHhh8XNHgoLe+mXTTEYXsu7P9FDro4PcG5T45Q1LVoZNm6OPOrdP4pGEi5vL9g== ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=hlinnaka smtp.mailfrom=hlinnaka@iki.fi Message-ID: Date: Thu, 27 Aug 2026 11:01:35 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: pg_upgrade silently truncates nextMultiOffset to 32 bits To: Chao Li , Masahiko Sawada Cc: PostgreSQL-development , Heikki Linnakangas References: Content-Language: en-US From: Heikki Linnakangas In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 27/08/2026 10:06, Chao Li wrote: >> On Aug 27, 2026, at 08:59, Masahiko Sawada wrote: >> >> Hi all, >> (CCing Heikki as the committer of commit bd8d9c9bdfa) >> >> Commit bd8d9c9bdfa widened MultiXactOffset to uint64, but I found that >> pg_upgrade still reads it as a uint32 value when reading the >> pg_controldata continents: >> >> else if ((p = strstr(bufin, "Latest checkpoint's NextMultiOffset:")) != NULL) >> { >> : >> p++; /* remove ':' char */ >> cluster->controldata.chkpnt_nxtmxoff = str2uint(p); >> >> I think it should use strtou64() instead. The attached 0001 patch >> fixes it. It introduces str2uint64() as other fields are read by a >> similar helper function str2uint(). >> >> Also, when checking other similar codes around the new >> MultiXactOffset, I found that pg_control_checkpoint() still reports >> the value as an xid. I think we should report it as bigint instead. >> What do you think? The attached 0002 patch fixes it. Thanks, good catch! > bigint is a signed int64, so it cannot represent the full uint64 range, although perhaps this is only a theoretical concern. If we want to avoid this limitation, should we use numeric instead? xid8 seems like the most straightforward replacement. It's a little bogus as a multixact offset it's not really an XID. But we were using the 32-bit 'xid' type for it previously, it's in line with that. I'll go do that. This requires bumping the catalog version, but since we've bumped it already since 19beta3, that's OK. - Heikki