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 1vvsau-007m97-2Z for pgsql-hackers@arkaria.postgresql.org; Fri, 27 Feb 2026 07:49:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vvsat-001e5d-27 for pgsql-hackers@arkaria.postgresql.org; Fri, 27 Feb 2026 07:49:03 +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 1vvsat-001e5V-1D for pgsql-hackers@lists.postgresql.org; Fri, 27 Feb 2026 07:49:03 +0000 Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1vvsaq-00000001Wzy-0uWu for pgsql-hackers@lists.postgresql.org; Fri, 27 Feb 2026 07:49:03 +0000 Received: by mail-pl1-x635.google.com with SMTP id d9443c01a7336-2adc1d9ec56so12052935ad.0 for ; Thu, 26 Feb 2026 23:49:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1772178539; x=1772783339; darn=lists.postgresql.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=tuGxLfYQxLd+33GAUNBXukiFlaf6xpxjaNg/Huld0N4=; b=GeqiWe/YXKrlaxtazULySwSufoIp7sjtExqsWS+PjqygdzfMbonpEa8e/rorc2vO/+ rrYJkE15Fm9BbYFnu0CK0lHyTMJ9/BdruZ204E3qMjMRYzvb7EPL0RTGohisEStwJzMA Sg47UtCdMRKv4sSs4G6/9mDDn1h1lHih7ocp2k16bIV74l7h2zAXWiPmRzcvVPp0PBfF 3xKXp+2/S/RcWFPyTAuplZvJSPPwVplu2f3kVTi2orF3iSADrdQ9cDKWxCOBMP4qaokg AiaZjC+Fr8PCHmxY/qnZnaol16KE5yqJRRAZ3MSCyowy68/AISB3+UwZ/7ZNz6cF6KVg ZXqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772178539; x=1772783339; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-gg:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=tuGxLfYQxLd+33GAUNBXukiFlaf6xpxjaNg/Huld0N4=; b=PdIkT5q4/d+op27KgiJ2QvMtNv5PQwKZS8hRWQ/vV98HOY7kquMA7sKeyooxRXQeOQ XSD1tpBk6Lbun0zEcAU2fQxFOFTmi5FtgqRYRNX2ADtzEQu529Pm9GbyBc9acGBzxLFI VBsW2T34uSfWIQ/FLhoX4GiuQBZx+2iY6f4gIHyHB7ARjUVu5SzBSTxQScoIOEVy+W0p fFHhQ8q/y6lb6kxQT4wgalxOcwBu7vBjoVi1jtR2v7/0uVbjKb8Vm5Bj8kPOPq23k1fC Gxg9dpzsYRxEAKCSgZcYcJivlHgE5BotLRfxn/CS73vUtmA26zhk5nBdywxMn2cpLnX5 fMWQ== X-Gm-Message-State: AOJu0Yx2AwsWy2saPRPk1Z1dGaVhIemDLtsLHF+jzprJfRfmw3bN9Zo2 VQHdTSaKM/A/PnDZNVn4WU+W7MPoT2YYelapyZfP56WUim4zmyxcwMCi X-Gm-Gg: ATEYQzxGSisqfnRdLR726SPznSH5FwnWbDOAM9GJGJiz80yzxVdbF28kzu6c5hmfWvw 6TVfjBl71Ts3MyFWD8SlA1EmT8yXcgbJjIHHRp8wACcW0cv8EYhi+lRoQcCcLa2Z4XOqtvB/K3H aZaWBrUtMDiN53CEPQ5DYkI3pwLFjKe/CvyPIS/1tLl7p1Tc7pBKRDyCDXwOOdf4sosHEsJdktS i1BcaawQHf8EFOzkvMCg6/az3jDEZLw/7qvuG087E7zAiqhpn7cXjPOVBKOFG75icJUME70M9ts 7YcS+rqqiBsDgs4iqj+L+6YQP1GsgmCw/HLxJpjLke+Poz3a8b81NoQiwBk598t35O0Dd8frXoL H8qwww3DAwoH2iQy9a3aNHQj4nEP0t5r7ZrVnOIQ0QUk8dEFC7fw/dFvogQiZfvX4HD3tKg5Yqc EskQsa/qzAhGVHqK8v6a7mq3mVT/+xlNY= X-Received: by 2002:a17:903:1212:b0:2ad:ad0f:bbc3 with SMTP id d9443c01a7336-2ae2e4965afmr19685855ad.33.1772178539081; Thu, 26 Feb 2026 23:48:59 -0800 (PST) Received: from smtpclient.apple ([45.32.121.103]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2adfb5c244asm54217635ad.30.2026.02.26.23.48.55 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Feb 2026 23:48:58 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3864.400.21\)) Subject: Re: Fix bug in multixact Oldest*MXactId initialization and access From: Chao Li In-Reply-To: Date: Fri, 27 Feb 2026 15:48:17 +0800 Cc: "pgsql-hackers@lists.postgresql.org" , Heikki Linnakangas , Andres Freund , Sami Imseih Content-Transfer-Encoding: quoted-printable Message-Id: <7D765C95-0FF5-4A7D-9C4F-B8DF0CB24906@gmail.com> References: <7acc94b0-ea82-4657-b1b0-77842cb7a60c@postgrespro.ru> <93F0BD0A-0B8B-4592-9D4B-53F405A86F6A@gmail.com> To: Yura Sokolov X-Mailer: Apple Mail (2.3864.400.21) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On Feb 27, 2026, at 00:22, Yura Sokolov = wrote: >=20 >=20 > Chao Li, new access functions doen't branch because I've made separate > functions to store at slots for prepared transactions. >=20 ``` + OldestMemberMXactId[procno - MaxChildren + MaxBackends] =3D = mxact; ``` Wow, this is clever. It removes NUM_AUXILIARY_PROCS from procno without = introducing an extra if check. However, I am not a big fan of the new global variable names: ``` MaxChildren =3D MaxBackends + NUM_AUXILIARY_PROCS; TotalProcs =3D MaxChildren + max_prepared_xacts; TotalXactProcs =3D MaxBackends + max_prepared_xacts; ``` MaxChildren is actually the total number of backends plus auxiliary = processes. Maybe something like MaxProcs would better reflect that? TotalProcs is really the length of the PGPROC array in shared memory. = Prepared transactions are not real processes; they just occupy some = slots in the proc array. So perhaps a name like MaxPGProcSlots or = MaxBackendAndPreparedSlots would be more accurate. As for TotalXactProcs, maybe something like MaxBackendAndPreparedSlots = would make the intent clearer. Anyway, I am not very good at naming things. You or others may have = better suggestions. Best regards, -- Chao Li (Evan) HighGo Software Co., Ltd. https://www.highgo.com/