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 1vTbZX-005iy0-2y for pgsql-hackers@arkaria.postgresql.org; Thu, 11 Dec 2025 07:58: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 1vTbZW-002ulG-2P for pgsql-hackers@arkaria.postgresql.org; Thu, 11 Dec 2025 07:58:47 +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 1vTbZW-002ul8-1A for pgsql-hackers@lists.postgresql.org; Thu, 11 Dec 2025 07:58:47 +0000 Received: from lahtoruutu.iki.fi ([2a0b:5c81:1c1::37]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vTbZU-0006lB-37 for pgsql-hackers@lists.postgresql.org; Thu, 11 Dec 2025 07:58:46 +0000 Received: from [10.0.2.15] (unknown [130.41.208.2]) (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 4dRlMZ6Kcgz49PxK; Thu, 11 Dec 2025 09:58:34 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1765439915; 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=w55rECW+j95Z6zXzuKZRCH1ee0lC2SB2HtmjyhRlAZg=; b=SESUDmk9vIWHyVjMSLGWgujI99rD7HOn/yMG+ksND94uksMTrGrvSw42EHdjUn2+emdaEd GlEYGBTfXjqHZ1TLNFXVjIvdKyYr5VYqOWPKtng7W32Li5KLIAKyMQmHfoGiP7XDtDQhdy 2xZutUvLE+3TR1kXBpzfGdsBTtf8mMpu572FBYCFHQCTFlYuSzmvjkDZlwrnCFxkx1CD6c 0kWE2tLMORTnJR5DvkpHDfe22r0OPZLZTRiaFI+4Dt0RKVVrYUyXN/YJ8UZFIHefN7cMMz 76OLRINwlpxK9IlA+ahPGdzcmyBTZghaLwqUxs65bsFLRBh77Iav2FO5DNMLrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1765439915; 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=w55rECW+j95Z6zXzuKZRCH1ee0lC2SB2HtmjyhRlAZg=; b=uLaEQO5XZJ2sxKDe2Hs6M7aeNqnfkOQb3DidaNPwbob7h6eAOI7TG+RijPo2WXu8H5G5Fn powM4sopenmcBNX8TVF4fQ7ZjjyidLdW1aBtRtU8qFcksJF4KV9tfr4pXRVB2Or3PmyE5s FEqchfgmS9fY5czFeFnjJR+5znIvnXvyX6mGxdM4XbxKaIJSqr5Q5frUl+OJV3szPqWXXP 1XsD/POZ7BakIVgE1LE7b3/6KYuF+SVcd9u4JQgSP4u5LV1Qv+2vEjUyjEZG+NMuTmhwDy XqBEAprUih1ymy4LbeF8ehAWLcjpRNDJs5f0sWUtIlfkSU3S+b3rLwdivPCc7g== ARC-Seal: i=1; a=rsa-sha256; d=iki.fi; s=lahtoruutu; cv=none; t=1765439915; b=Ajj/Esq89cwdmggRXpv9+qiyMzNCscUZA92gZ4a7coj8m/8IypCXlnHemJevdA4Z5s0S6D vXUCVOQQ1p+p/3sVtenhUGXVd5rspfo+ZR0S17jgVdxhO3me+IRl6cpCg75MsTHdbDJWDq /AfNs4I6T7bQKTZSG92325PdWZHy6kcGNpGNUZAJ5OwGnEVXNo0G42gB0q/iJxpzFyvVsC a/F4blOEHV3RjUddrZuAbpI3wJ74bYdD8S8b3vNElQZmsCdKYhTX4C0MhDNbcBwn3/ud3a wYkdMKXQsK7EoWfWlFOyHZcB4Yz5kAB8tncn1MDMzDdD0uY4nrafwhUuLGvBzQ== ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=hlinnaka smtp.mailfrom=hlinnaka@iki.fi Message-ID: <2c7d4202-31d4-4254-8ed0-484083b14624@iki.fi> Date: Thu, 11 Dec 2025 09:58:34 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: POC: make mxidoff 64 bits To: Ashutosh Bapat , Alvaro Herrera Cc: Maxim Orlov , Alexander Korotkov , wenhui qiu , Postgres hackers References: <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> <2c62322e-a0e3-49cd-b369-370718a8efd8@iki.fi> <3624730d-6dae-42bf-9458-76c4c965fb27@iki.fi> Content-Language: en-US From: Heikki Linnakangas In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 11/12/2025 05:06, Ashutosh Bapat wrote: > On Thu, Dec 11, 2025 at 12:49 AM Heikki Linnakangas wrote: >> >> On 09/12/2025 14:00, Heikki Linnakangas wrote: >>> 1. Currently, at multixid wraparound, MultiXactState->nextMXact goes to >>> 0, which is invalid. All the readers must be prepared for that, and skip >>> over the 0. That's error-prone, we've already missed that a few times. >>> Let's change things so that the code that *writes* MultiXactState- >>> >nextMXact skips over the zero already. >> >> Here's a patch for that. Does anyone see a problem with this? > > The patch looks fine to me. It simplifies readers without affecting > writers much. I was expecting more explanation of why it wasn't done > that way to start with and why is it safe to do so (now, if > applicable). There must be a reason why we chose to make readers > handle invalid mxid instead of writers writing one. If it's for > performance reasons then does the new arrangement cause any > regression? If it's for safety reasons, are we fixing one set of > problems but introducing a new set. I was expecting commit message to > answer those questions. That's a great question and I've been wondering about it myself. It goes all the way to the initial commit where multixacts were introduced, and I don't see any particular reason for it even back then. Even in the very first version of multixact.c, IMO it would've been simpler to have the writer handle the wraparound. Álvaro, would you happen to remember? - Heikki