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.94.2) (envelope-from ) id 1tV6kz-005WtU-Pj for pgsql-hackers@arkaria.postgresql.org; Tue, 07 Jan 2025 10:24:18 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tV6kx-0028tK-WE for pgsql-hackers@arkaria.postgresql.org; Tue, 07 Jan 2025 10:24:15 +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.94.2) (envelope-from ) id 1tV6kx-0028tB-KB for pgsql-hackers@lists.postgresql.org; Tue, 07 Jan 2025 10:24:15 +0000 Received: from mail-ed1-x530.google.com ([2a00:1450:4864:20::530]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tV6ku-000KLN-0t for pgsql-hackers@lists.postgresql.org; Tue, 07 Jan 2025 10:24:14 +0000 Received: by mail-ed1-x530.google.com with SMTP id 4fb4d7f45d1cf-5d3e5c225aaso3242163a12.3 for ; Tue, 07 Jan 2025 02:24:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1736245451; x=1736850251; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=tXIhalSXI1P7SXqmbDgEQyjliL/C4pLxicPYxMOi3Dc=; b=g0tWmhuGdpBGSMXfZYWLebtY8cr/4a6OZ5yny83lrABLC6m0lo/02sWoZWGNXYHXXM UHvKolr3zo7/R9AdzfUJSPI21TaCsNKKkoQMSPr8TLtpH6mZHz1+lnzSJlNudPTAYSFw 2gbhG7xFpan/tf5YGANDpiYASi7BAtsE5yvNzFGg3mENEl1HngDus6Q0LstdJ40Z6bfp CiBLtgADYGyzDF/xd3PYAMGnHU1M44jaXk8o/pMmXRoauNTvauz43WdjXByVd6XWUAey S0zWUyt/GyYgXLCNlGqo0iO3eATVOZb8YtWM7SDOT+f408njVKnYKCF2UXmlsXr1egJZ r5UQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736245451; x=1736850251; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=tXIhalSXI1P7SXqmbDgEQyjliL/C4pLxicPYxMOi3Dc=; b=WeDfHEEoY1BIAjF5FROuRy67j4wfKdkg2a+2kR8WHGEVDVWKG5Te5XhD4RiitAl6iT XxrQ0dPXh6gcfZQvVeT1j18e7rWCUnRP4pKANRyVDofSKhK/yco0gQhyGrmmhZjjS2L1 FoYzsWk3+FBQwaHuLImMRXGmis/1OsgAlCOIxMq65Hs/q6UAlWhlJQC6dDXRCRHX7fIy a+kHWcB2IE81gmSajPCP1Zfe1f/GBMbY9yXRX4KiLgdjmlLIN4zYn4UYLBCb/nOFucGU xv9Glo5OUJyL8uBqQSf15YBQUaZbptaFXNy/ZsDYHaxFIMp9BTR0/5axdB83b0sP6d9T gLgg== X-Forwarded-Encrypted: i=1; AJvYcCVacUBNXwnQg2C/QjgItri8QzZ02wrNxK3SSxVk+QXIufb+mFn59qabyRe14/Qxl95VVwycmjKWzgc1YvK8@lists.postgresql.org X-Gm-Message-State: AOJu0Yy/zkBf1ZVmmN1/nI+wyJ2BHlgE+OyyjjqTuDAkz2Jo8WMEuF1c QL5viKTCWJYI4Vu6IA1ef1jDWZMQB5AyAn0YI9b8/B+HNrFRtF2gjqtttHXyqvfhZrneXDkj2/v lXziwP+AYn2n2RLF4vDlQZGaUIQY= X-Gm-Gg: ASbGncuDtyhdNpeTaSAY6sDtMt1XXADmnIc1Lh+Anqm9ATyREmoCYoTQ5TIBHfhVsMH xbgKR1bD6lcs0Qj0Yyl9cZZ7v0uxbDdp348LH0A== X-Google-Smtp-Source: AGHT+IHGJ7rBS0uXZA/yz8rRQxcCH3hyn8ekduV3jp1pphYv4xuoY43P1vdVDsRwFePfeJt8sRwp+QesOhDzcppgNRs= X-Received: by 2002:a05:6402:51cc:b0:5cf:cc32:82f2 with SMTP id 4fb4d7f45d1cf-5d81ddaf985mr18382517a12.5.1736245450579; Tue, 07 Jan 2025 02:24:10 -0800 (PST) MIME-Version: 1.0 References: <5ecc35f5-1111-47fc-8a02-36d89490a50d@iki.fi> <24b3deb6-a732-4256-847a-560f4bf39d59@iki.fi> <4535f3aa-3220-4760-b1f5-2bc91f248e03@iki.fi> <2bc58592-9d74-4af0-bdd1-1a88e8683f7c@iki.fi> In-Reply-To: <2bc58592-9d74-4af0-bdd1-1a88e8683f7c@iki.fi> From: Maxim Orlov Date: Tue, 7 Jan 2025 13:23:59 +0300 Message-ID: Subject: Re: POC: make mxidoff 64 bits To: Heikki Linnakangas Cc: wenhui qiu , Alexander Korotkov , Postgres hackers Content-Type: multipart/alternative; boundary="00000000000053263f062b1b254d" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --00000000000053263f062b1b254d Content-Type: text/plain; charset="UTF-8" On Thu, 2 Jan 2025 at 01:12, Heikki Linnakangas wrote: > > It might be best to just refuse the upgrade if oldestOffsetKnown==false. > It's a very ancient corner case. It seems reasonable to require you to > upgrade to a newer minor version and run VACUUM before upgrading. IIRC > that sets oldestOffsetKnown. > I agree. After all, we do already have a ready-made solution in the form of a vacuum, do we? If I understand all this multixact_old.c machinery correctly, in case of oldestOffsetKnown==false we should fail with "could not open file" or offset will be 0 in GetOldMultiXactIdSingleMember. So, I suppose we can put an analogue of SimpleLruDoesPhysicalPageExist call in the beginning of GetOldMultiXactIdSingleMember. And if either SimpleLruDoesPhysicalPageExist return false or a corresponding offset will be 0 we have to bail out with "oldest offset does not exist, consider running vacuum before pg_upgrdade" or smth. Please, correct me if I'm wrong. -- Best regards, Maxim Orlov. --00000000000053263f062b1b254d Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Thu, 2 Jan 2= 025 at 01:12, Heikki Linnakangas <hli= nnaka@iki.fi> wrote:

It might be best to just refuse the upgrade if oldestOffsetKnown=3D=3Dfalse= .
It's a very ancient corner case. It seems reasonable to require you to =
upgrade to a newer minor version and run VACUUM before upgrading. IIRC
that sets oldestOffsetKnown.
=C2=A0
I agree.= =C2=A0 After all, we do already have a r= eady-made solution in the form of a vacuum, do we?

If I understand all this=C2=A0= multixact_old.c machinery = correctly, in case of oldestOffsetKnown=3D=3Dfalse
we should fail with "could not open file" or offset will b= e 0 in GetOldMultiXactIdSingleMember.
So, I suppose we can put an= analogue of SimpleLruDoesPhysicalPageExist call in the beginning
of=C2=A0GetOldMultiXactIdSingleMember. And if either SimpleLruDoesPhysical= PageExist return false
or a corresponding offset will be 0 we hav= e to bail out with "oldest offset does not exist, consider
r= unning vacuum before pg_upgrdade" or smth. Please, correct me if I'= ;m wrong.

--
<= div dir=3D"ltr" class=3D"gmail_signature">
Best regard= s,
Maxim Orlov.
--00000000000053263f062b1b254d--