From: Heikki Linnakangas <hlinnaka@iki.fi>
To: Michael Paquier <michael@paquier.xyz>
Cc: Naga Appani <nagnrik@gmail.com>
Cc: pgsql-hackers@lists.postgresql.org, Noah Misch <noah@leadboat.com>
Subject: Re: [Patch] Fix pg_get_multixact_stats() over-reporting members on a hot standby
Date: Mon, 21 Sep 2026 18:21:30 +0300
Message-ID: <4050bb5e-e8d5-4cd1-a65c-3f710c807cb9@iki.fi> (raw)
In-Reply-To: <arDdM0MrPGgFhNpQ@paquier.xyz>
References: <CA+QeY+DcnsZRL4GZD8JyJu5HD-d6p8_9M5kT4jgF3gq3Rh8n4w@mail.gmail.com>
<e47084b7-d17b-4017-a530-05ec7d8d8385@iki.fi>
<arDdM0MrPGgFhNpQ@paquier.xyz>
On 21/09/2026 10:30, Michael Paquier wrote:
> On Mon, Sep 21, 2026 at 10:19:47AM +0300, Heikki Linnakangas wrote:
>> Hmm, the window could be very long, there's no guarantee that you'll see a
>> MULTIXACT_TRUNCATE_ID record any time soon. And after restart, it'll revert
>> back to 0 again. If we can't get a reasonable value at startup, I wonder if
>> we should just always show NULL in the standby.
>
> I'd like to think that we should just throw an ERROR in this case with
> a ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE, similarly to a lot of the
> WAL functions. NULL is useful when for example using such a function
> with a JOIN on catalogs, when called for a lot of tuples, but that's
> not the case here.
That would disable pg_get_multixact_stats() in a standby altogether, but
only the members-related fields (num_members, members_size) have this
problem. So that would throw some babies out with the bathwater. It's a
new function so we could still do it though, if that's what we want.
Another idea is to add the oldestOffset field to the control file. I
actually find it a little weird that we don't have it there already. But
I'm uncomfortable making that change so late in the release cycle, just
for this function, in particular because it would require a catversion bump.
- Heikki
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: hlinnaka@iki.fi, michael@paquier.xyz, nagnrik@gmail.com, noah@leadboat.com
Subject: Re: [Patch] Fix pg_get_multixact_stats() over-reporting members on a hot standby
In-Reply-To: <4050bb5e-e8d5-4cd1-a65c-3f710c807cb9@iki.fi>
* 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