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 1wzUCH-0042fO-1d for pgsql-hackers@arkaria.postgresql.org; Thu, 27 Aug 2026 07:06:49 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wzUCG-000VGX-1R for pgsql-hackers@arkaria.postgresql.org; Thu, 27 Aug 2026 07:06:48 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wzUCG-000VGO-0E for pgsql-hackers@lists.postgresql.org; Thu, 27 Aug 2026 07:06:48 +0000 Received: from mail-pj1-x1033.google.com ([2607:f8b0:4864:20::1033]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wzUCD-00000002dwL-3kBa for pgsql-hackers@postgresql.org; Thu, 27 Aug 2026 07:06:47 +0000 Received: by mail-pj1-x1033.google.com with SMTP id 98e67ed59e1d1-395cf2535acso900161a91.1 for ; Thu, 27 Aug 2026 00:06:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1787814405; x=1788419205; darn=postgresql.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:content-type:from:to:cc :subject:date:message-id:reply-to:content-type; bh=5o38CAYt4dQJJTi3y531IRuehjXZZxeznrugR5YzNE4=; b=haUKCUpk4PCWTYrUHNSsPKwQX/WS9YEmf+LsQ2GVYlTzQAlA93DE4cBudq0a5Zw+Cv +byijBwsd8kKfp8ud+VlrqUIVzZdNiUqtrD7KJwtVjy3DKDowRbRgQpzZoDv3ju6dQ7c q20IMou/vtE5+YiO0MnUN5zAf98s7tmhzriuFRz1DKhLopqRdN82r0d/3xnQ8cQacO7X QJJzIZnY0D6H1cixRCHy3vUZ93LlystE18HIphG6GXsbkZqsUvzhP5wnre9Qa0pQKnta GvpD2QTksZqPqrAf3DE8O72D1zqBPPePVDDIOHJTRqAahdccA9aoYLJzFyBHFNeLXj6W I8Rw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787814405; x=1788419205; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:content-type:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=5o38CAYt4dQJJTi3y531IRuehjXZZxeznrugR5YzNE4=; b=VgO+2zmQWOvPdOXXzGZAS/kq8NudWKYnPQU+9pQqn49idi7NKJxHEEUSwQqzXZMAQh G7RgSYC4Dm2aCmm3bX1XLkotNU8vzgizZC7TYcZ+GQ6ADvf/Kh3gyAX+u/2n+WqCG/S0 HtcogXgNfQNxf5pUDshpShqoc5mOhpLa3ra+ftl8kbOjgdzm5LGMvPrP82XdTiwmGIIk o/NqvfzJq+FwAdUYsBoaN3iE08Jwlbx6f13KfOaTLfwh1cxAU6DwV/dC2Q/ZS8rGPNcf o00OdJbVaQGeeqi32ZzlBcve1tUMVHGEU4IjMZeSBEiaGLqqMPl7uvKfB3bcPLdHOmqt 1VAQ== X-Gm-Message-State: AFuF++nFBMfcZA2lePB9DV/i0kfCqXUXLtHAXwJdYcUF9aMPzoq5wwD+ tSqYlfVDKu8RiXu8ROrgJGm31JuiNG9zhKViTe1CMNru57hYMFziaf8/ X-Gm-Gg: AR+sD12vjo+0sHo3R3oFmx7pdLvxB+BYFvA1vOu96ovI+pY5BGa0a195d4WSdaOpc8L Hly8KkO8n+Uat/Vkm+CLufPUdDybQFATGWgjpKePoPhVV5zN0tXCW35V5P+qSOsw4/nabz0FX76 gIHDZyTaPJMsBnLHkhGPBoY+nw/Qd3wbpK2TsIaazvFSqtFqd6R3/MnpGYnaM3s7pmpP6ptIQg+ jTxM54fbg0VbLFs696fNp0zhvDNVH2vlmLOqzEENfiNHroFWURSScUZGPTGv1eDLm7uTI+ukDGZ giKe3FVWq+qE7qzv8RWzQoEQyz2/GhbmWK4XC0QAPD10p5byd4bxg/VZLxp1XPVqD7KcrGR6JMw QtF6wmEtvIuA4X8lPnAAtpgD4qZDnhRVV2xWM2kAq1LzEtkn2zttkOqHz3T8jjG2IL1JWLOlJI0 SCjjF7uAuykfwknZNGXJ22LWaPJnlGKKg5Ltn3AhuIH9Jwo/USMbnOmHqUt14CIJGjDUCNxh6W2 06ZmCRy X-Received: by 2002:a17:90b:4fc8:b0:38f:de94:bf34 with SMTP id 98e67ed59e1d1-3969bc2f7b0mr5159540a91.10.1787814404589; Thu, 27 Aug 2026 00:06:44 -0700 (PDT) Received: from smtpclient.apple ([185.135.79.125]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-396b0ea80a2sm1568421a91.3.2026.08.27.00.06.41 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 27 Aug 2026 00:06:43 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3864.600.51.1.1\)) Subject: Re: pg_upgrade silently truncates nextMultiOffset to 32 bits From: Chao Li In-Reply-To: Date: Thu, 27 Aug 2026 15:06:08 +0800 Cc: PostgreSQL-development , Heikki Linnakangas Content-Transfer-Encoding: quoted-printable Message-Id: References: To: Masahiko Sawada X-Mailer: Apple Mail (2.3864.600.51.1.1) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On Aug 27, 2026, at 08:59, Masahiko Sawada = wrote: >=20 > Hi all, > (CCing Heikki as the committer of commit bd8d9c9bdfa) >=20 > 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: >=20 > else if ((p =3D strstr(bufin, "Latest checkpoint's NextMultiOffset:")) = !=3D NULL) > { > : > p++; /* remove ':' char */ > cluster->controldata.chkpnt_nxtmxoff =3D str2uint(p); >=20 > 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(). >=20 > 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. 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? >=20 > Regards, >=20 > --=20 > Masahiko Sawada > Amazon Web Services: https://aws.amazon.com > = <0002-Report-next_multi_offset-as-bigint-in-pg_control_che.patch><0001-pg_= upgrade-Read-nextMultiOffset-as-a-64-bit-value.patch> Overall the patch looks good to me. Best regards, -- Chao Li (Evan) HighGo Software Co., Ltd. https://www.highgo.com/