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 1vDkVo-00EyVj-GG for pgsql-hackers@arkaria.postgresql.org; Tue, 28 Oct 2025 14:17:24 +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 1vDkVm-00DGhT-Oc for pgsql-hackers@arkaria.postgresql.org; Tue, 28 Oct 2025 14:17:21 +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 1vDkVm-00DGhL-CY for pgsql-hackers@lists.postgresql.org; Tue, 28 Oct 2025 14:17:21 +0000 Received: from lahtoruutu.iki.fi ([2a0b:5c81:1c1::37]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vDkVj-004i4I-0m for pgsql-hackers@lists.postgresql.org; Tue, 28 Oct 2025 14:17:21 +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 4cwsrm1rlfz49QJX; Tue, 28 Oct 2025 16:17:12 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1761661033; 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=NLrYAp2pPvq0BAAVrEo1DKsDKJOIpbDEZy54JkzWFxA=; b=Qi1GT9/OuIqejMNHTDeAMM1UqGN2SxDo77+8bKD1C4f9Owp7X2YQKMtC6G1l/WdsW3SpNy 8pYDllpeWZ4O3XrY1xI8YW0C2MnMr4imsk7Tnu1s2FxJVJSOjB+yLbKrBp3BKUCuGsTRPR CzH4hstnSSIxcAQqXsCuk8rFdijuK/w+efFJyMohPoXxrUSwa8fAWM0pxOqW0Ovx8DtC1y C2SsJjvW1KsasFoK6XVexWKlw81ZSLqBS2OUyKmJgnn0oK56fziIo1ovFHIq/ztYIKB/jD d7CYQWO7MU0FJi30LAAeNWtjEZ2XUA1EtX+69uPF/6AAQEk0XJXpmJqaS8tRdQ== ARC-Seal: i=1; s=lahtoruutu; d=iki.fi; t=1761661033; a=rsa-sha256; cv=none; b=QfOGZX0nW4p/G+/BpER/rkiPZecgE5st6UPp+R6DJOn6m63BRyh7qw6F16Sn67x21ywDGu mmwS2Se2rwhatJUXlv6pTPr/YVZ3DsPdCyn1QmbWLUlSofmfdhI1T8YCZI+a3/remXMEcb qgwbo3nzWG1H06SotrupeXwCitmhOpLdHdubhLWbqXYCT0Xo9BtFMH1UC9FzIwT8cP9dg9 +UaapE03p508y0HnInTwTtdiZCYcnwGbmkOmLNuhIvTkSwjaX3QUtQXIsrLwKUf5T1qDSj /FwfsNqNXOAHwYFx+UjFL4EJLtRh5hkSE4sQYtkYowg99sWckRnhA8tTPJfAqw== ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=hlinnaka smtp.mailfrom=hlinnaka@iki.fi ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1761661033; 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=NLrYAp2pPvq0BAAVrEo1DKsDKJOIpbDEZy54JkzWFxA=; b=HHDCqmVGun+KlQbhMbuCO85Q+GqX1Q5gUEdj13C3orgeNzSj2ld1NnokxrdCy7saJMLMmc GoiWkV+nyIBbSyyWuC7Sp5PO/EnchUcbPV2Kfi764j6WdZRw0Ju5jT2J/lFpHmtcOYTtUa poWAOww47g8qw1yEb1VcUtGQhk/1nxwpSZPjNlN++VTbxWCmpAWVfzCWMl55lej8gG1VeP ZU6V9dif5SfA90Fkim/F0IOBYtZV76dudpl3O1MvlnOANvBCsxxUwwznywlr5+Gqh/vWqt DGap/wJ8qIQBzcq0YG1kgwdIKgDnYFzghgT8t0Obx7F0KxE/1sOP91Q60hx73A== Message-ID: Date: Tue, 28 Oct 2025 16:17:11 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: POC: make mxidoff 64 bits To: Maxim Orlov , wenhui qiu Cc: Alexander Korotkov , Ashutosh Bapat , Postgres hackers References: Content-Language: en-US From: Heikki Linnakangas In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 27/10/2025 17:54, Maxim Orlov wrote: > Here is a new patch set @ 10b5bb3bffaee8 > > As previously stated, the patch set implements the concept of saving the > "difference" between page offsets in order to save disc space. Hmm, is that safe? We do the assignment of multixact and offset, in the GetNewMultiXactId() function, separately from updating the SLRU pages in the RecordNewMultiXact() function. I believe this happen: To keep the arithmetic simple, let's assume that multixid 100 is the first multixid on an offsets SLRU page. So the 'base' on the page is initialized when multixid 100 is written. 1. Backend A calls GetNewMultiXactId(), is assigned multixid 100, offset 1000 2. Backend B calls GetNewMultiXactId(), is assigned multixid 101, offset 1010 3. Backend B calls RecordNewMultiXact() and sets 'page->offsets[1] = 10' 4. Backend A calls RecordNewMultiXact() and sets 'page->base = 1000' and 'page->offsets[0] = 0' If backend C looks up multixid 101 in between steps 3 and 4, it would read the offset incorrectly, because 'base' isn't set yet. - Heikki