pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Chao Li <li.evan.chao@gmail.com>
To: Sami Imseih <samimseih@gmail.com>
To: Heikki Linnakangas <hlinnaka@iki.fi>
Cc: Yura Sokolov <y.sokolov@postgrespro.ru>
Cc: pgsql-hackers@lists.postgresql.org <pgsql-hackers@lists.postgresql.org>
Subject: Re: Fix bug in multixact Oldest*MXactId initialization and access
Date: Mon, 2 Mar 2026 12:08:02 +0800
Message-ID: <A0249625-0EF4-4068-854F-0592139DFBC1@gmail.com> (raw)
In-Reply-To: <CAA5RZ0umyHiQNwr1m6FVF0WPCP3QAFAzdF=mQ+_u-vknhOBYWw@mail.gmail.com>
References: <7acc94b0-ea82-4657-b1b0-77842cb7a60c@postgrespro.ru>
	<93F0BD0A-0B8B-4592-9D4B-53F405A86F6A@gmail.com>
	<c3eaaac1-d244-4e4d-b5d7-06c284108eac@postgrespro.ru>
	<C991344D-F38A-4EEC-903A-72B52FF887FA@gmail.com>
	<bf2951b4-687b-4bd3-a072-46deb463f177@postgrespro.ru>
	<CAA5RZ0t8iGnqO3JcAZP1VEjCspcnZtQ0GFFVGLNLAsFqfHqRsw@mail.gmail.com>
	<ebeb0db1-0eb2-4439-a6c8-1d96b60b25ad@postgrespro.ru>
	<CAA5RZ0s+rr=DVkFnMwupgnCAvPjJkjQ3jr5=7X_=Sb5Mr02-Mg@mail.gmail.com>
	<3d7a2207-0e61-4d95-bc00-e5248956a32b@postgrespro.ru>
	<366b6f95-613d-4ef8-82e4-bb2fd06d9c4d@iki.fi>
	<CAA5RZ0vXCMHEsPg7wFXmBOEPgWB8NvGKWx9cZsz7F99mFU+xLw@mail.gmail.com>
	<231cd950-73e9-4db5-a516-c5216af7b93a@iki.fi>
	<944d7897-3ec3-47bb-9e93-b99f2ef3124a@postgrespro.ru>
	<CAA5RZ0umyHiQNwr1m6FVF0WPCP3QAFAzdF=mQ+_u-vknhOBYWw@mail.gmail.com>



> On Mar 2, 2026, at 10:34, Sami Imseih <samimseih@gmail.com> wrote:
> 
>> New version attached.
> 
> The comment here:
> 
> +static inline MultiXactId *
> +PreparedXactOldestMemberMXactIdSlot(ProcNumber procno)
> +{
> +       /*
> +        * The entries with indexes >= MaxBackends in the OldestMemberMXactId
> +        * array are reserved for regular backends.
> 
> should say "array are reserved for prepared transactions"
> 

+1

And I saw the other code comment in multixact.c around line 162 needs an update because of this patch:
```
* Per-backend data starts here. We have two arrays stored in the area
* immediately following the MultiXactStateData struct. Each is indexed by
* ProcNumber.
```

It says “Each is indexed by ProcNumber”, but it’s no longer accurate for OldestMemberMXactId prepared-xact entries, which now use index (procno - FIRST_PREPARED_XACT_PROC_NUMBER).

Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/









view thread (31+ messages)  latest in thread

Message-ID: <A0249625-0EF4-4068-854F-0592139DFBC1@gmail.com>
Permalink:  ../A0249625-0EF4-4068-854F-0592139DFBC1@gmail.com/
Also on:    postgresql.org/message-id/A0249625-0EF4-4068-854F-0592139DFBC1@gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: li.evan.chao@gmail.com, samimseih@gmail.com, hlinnaka@iki.fi, y.sokolov@postgrespro.ru, pgsql-hackers@lists.postgresql.org
  Subject: Re: Fix bug in multixact Oldest*MXactId initialization and access
  In-Reply-To: <A0249625-0EF4-4068-854F-0592139DFBC1@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox