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 1vOyM2-00FVhg-0k for pgsql-hackers@arkaria.postgresql.org; Fri, 28 Nov 2025 13:17:42 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vOyM0-00BQUC-2j for pgsql-hackers@arkaria.postgresql.org; Fri, 28 Nov 2025 13:17:41 +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 1vOyM0-00BQU2-1b for pgsql-hackers@lists.postgresql.org; Fri, 28 Nov 2025 13:17:40 +0000 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vOyLy-001zYt-2G for pgsql-hackers@lists.postgresql.org; Fri, 28 Nov 2025 13:17:40 +0000 Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-42b3c965df5so1136695f8f.1 for ; Fri, 28 Nov 2025 05:17:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1764335857; x=1764940657; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=1RXtQfvLJsK1ynIxGIXc72yAEu/auHq3NoNeYnZ8Mgs=; b=U7zuD69buvPtkaEdVaI1AeddbBxtKo1L+z31ztiX+pgY0apfPHMfZMztyI5pIsjiOu zlRuwbnMClY9nq/xjkgWaatSw07K0n7fBdGfUn9AEonVZbUMs3JQ2aAURtmup6YjGHuq 9KQp29qK6woOOFkkrKf2ix8Lc5Nu042ggtT17CXeBzr+VvjJLJ37TsGMWvNcBYN4J4Qm /EXBHwQNhQqmR8ZUqPFOrh43mnG1o7Vo3A9r+aO/X9uO7aPXnqKzup/aqSKrmztHeqjC EHfWRUxxVi59uRLhARiTDPVWGOZryFIs2cRnpOe9ns+lNefypasWF2+S6uAkuLy3yUY1 a/8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764335857; x=1764940657; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=1RXtQfvLJsK1ynIxGIXc72yAEu/auHq3NoNeYnZ8Mgs=; b=Zrqm73x5MxrslYLzqe8Eij8G5dNAnQOuWTsz3M7wZQHqm6bQ/CpBRNMsI7qMYzfxs/ UCai2wGkPnYNxpnN0L+ZQ7cBtOdfcNWcBSh3fXCtS1AQkXtzlHOMQnINn0BAKSirPbTe P1GZW1jOWky1K/5+dBWCFuLBoezX3mrcK3hwqdsZ2ZJHKmuJ2sQp1Rz4Kh0HPyCWB40V UP03b7Yp2tVWJYQXS262HTdc2PXNmhFVyGwCav5Zcfq8G6T7Y6ZQDiOKESz1sOslp2/Q 9Wu5trVGblFyJwiBRTjC/s0GyhGpdtEjJFsp7JqMfXa1Wn0N9Bj9+zMc11p05zV+isTM aAAg== X-Forwarded-Encrypted: i=1; AJvYcCX/kKW6cJXqiwpkcWQslrayMZKEfBZaQo2N5Mweh9GTO/vBTTXOdJS4B9Afesnrbq47XzLa3CnyscLJDfI7@lists.postgresql.org X-Gm-Message-State: AOJu0YydlIPM2O5X4jWUytpEZZyCZ5aZC4NJZhhQL6k2EI2YPElyjgfd +upyLvq5GlURhNq+4JUhxFGd9QhvdEfV2emPj2rT8e5cJhgXe1yxk8lbb6N1m4HNFtBT78LZ7SC JI4PEo4uGbyLIcYEddbHWoDOgow1xCvw= X-Gm-Gg: ASbGncv8VWxP7i20AC2Jkg/7230HWa0kTTmD9S8A9UZ3NQFOSEa3b/nDNYYXeFSKexc 0eOI8s3Rq/tnGJcAg/vHa15KDCAm43mPmjiYwPLIBklKqNzqqpo8B9k91otqwtIzV6UesPN8bmj VKKMiNrSAW+OdvW8j6fVyxNfo35QbVs7iH46j/2WH30CaHLnXJIrT7AK//XGGNQEymAfC5Mgn8x JuVVBp0vDbaFFPlo3jwG3JqrT2n1qg288pT5q8pRn0qFK7vM/04azradDgXzxWkWRKK0ZzG X-Google-Smtp-Source: AGHT+IGhXOsBwkNDc8R2mOcZwqKrJ6CuJyXXOizCHCn+C7z3YTjrAB+zvFb5nHqB53nLXSt76JxxuoJTG04IYxeJxe0= X-Received: by 2002:a5d:5d05:0:b0:3ec:ea73:a91e with SMTP id ffacd0b85a97d-42e0f1e35f4mr16330057f8f.12.1764335857363; Fri, 28 Nov 2025 05:17:37 -0800 (PST) MIME-Version: 1.0 References: <4535f3aa-3220-4760-b1f5-2bc91f248e03@iki.fi> <2bc58592-9d74-4af0-bdd1-1a88e8683f7c@iki.fi> <36531c0e-292c-409d-bbc7-a252cf6e910a@iki.fi> <54aa8f65-f0e4-4464-b543-e0399c1cab1e@iki.fi> <4a9dda70-0af7-41a4-9636-b168f2fc48ef@iki.fi> <46cc45e9-fddd-44bc-bcb3-96889aafd921@iki.fi> <6c298bc4-7029-4c1d-bf16-3e094842ce32@iki.fi> In-Reply-To: From: Ashutosh Bapat Date: Fri, 28 Nov 2025 18:47:24 +0530 X-Gm-Features: AWmQ_bnh-FH5TQtyQhgD9FPZOl9crAaLEUgRWuSmXYJoaY0cGJKt3FLm7KH0yAg Message-ID: Subject: Re: POC: make mxidoff 64 bits To: Heikki Linnakangas Cc: Maxim Orlov , Alvaro Herrera , Alexander Korotkov , wenhui qiu , Postgres hackers Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Fri, Nov 28, 2025 at 6:35=E2=80=AFPM Ashutosh Bapat wrote: > > On Fri, Nov 21, 2025 at 7:26=E2=80=AFPM Heikki Linnakangas wrote: > > > > > > > I have reviewed patch 0002 and multxact.c changes in 0003. So far I > > > have only these comments. I will review the pg_upgrade.c changes next= . > > 007_multixact_conversion.pl fires thousands of queries through > BackgroundPsql which prints debug output for each of the queries. When > running this file with oldinstall set, > 2.2M regress_log_007_multixact_conversion (size of file) > 77874 regress_log_007_multixact_conversion (wc -l output) > > Since this output is also copied in testlog.txt, the effect is two-fold. > > Most, if not all, of this output is useless. It also makes it hard to > find the output we are looking for. PFA patch which reduces this > output. The patch adds a flag verbose to query_safe() and query() to > toggle this output. With the patch the sizes are > 27K regress_log_007_multixact_conversion > 588 regress_log_007_multixact_conversion > > And it makes the test faster by about a second or two on my laptop. > Something on those lines or other is required to reduce the output > from query_safe(). > > Some more comments > +++ b/src/bin/pg_upgrade/multixact_old.c > > We may need to introduce new _new and then _old will become _older. > Should we rename the files to have pre19 and post19 or some similar > suffixes which make it clear what is meant by old and new? > > + > +static inline int64 > +MultiXactIdToOffsetPage(MultiXactId multi) > > The prologue mentions that the definitions are copy-pasted from > multixact.c from version 18, but they share the names with functions > in the current version. I think that's going to be a good source of > confusion especially in a file which is a few hundred lines long. Can > we rename them to have "Old" prefix or something similar? > > + > +# Dump contents of the 'mxofftest' table, created by mxact_workload > +sub get_dump_for_comparison > > This local function shares its name with a local function in > 002_pg_upgrade.pl. Better to use a separate name. Also it's not > "dumping" data using "pg_dump", so "dump" in the name can be > misleading. > > + $newnode->start; > + my $new_dump =3D get_dump_for_comparison($newnode, "newnode_${tag}_dump= "); > + $newnode->stop; > > There is no code which actually looks at the multixact offsets here to > make sure that the conversion happened correctly. I guess the test > relies on visibility checks for that. Anyway, we need a comment > explaining why just comparing the contents of the table is enough to > ensure correct conversion. Better if we can add an explicit test that > the offsets were converted correctly. I don't have any idea of how to > do that right now, though. Maybe use pg_get_multixact_members() > somehow in the query to extract data out of the table? > > + > + compare_files($old_dump, $new_dump, > + 'dump outputs from original and restored regression databases match'); > > A shared test name too :); but there is not regression database here. > > + > + note ">>> case #${tag}\n" > + . " oldnode mxoff from ${start_mxoff} to ${finish_mxoff}\n" > + . " newnode mxoff ${new_next_mxoff}\n"; > > Should we check that some condition holds between finish_mxoff and > new_next_mxoff? > > I will continue reviewing it further. One more thing, An UPDATE waits for FOR SHARE query to finish, and vice versa. In my experiments I didn't see an UPDATE creating a multi-xact. Why do we have UPDATEs in the load created by the test? Am I missing something? --=20 Best Wishes, Ashutosh Bapat