Re: POC: make mxidoff 64 bits

Alvaro Herrera <alvherre@alvh.no-ip.org>

From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: Maxim Orlov <orlovmg@gmail.com>
Cc: Heikki Linnakangas <hlinnaka@iki.fi>, Alexander Lakhin <exclusion@gmail.com>, Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>, Alexander Korotkov <aekorotkov@gmail.com>, wenhui qiu <qiuwenhuifx@gmail.com>, Postgres hackers <pgsql-hackers@lists.postgresql.org>
Date: 2026-02-25T17:38:43Z
Lists: pgsql-hackers
On 2026-Feb-25, Maxim Orlov wrote:

> Something of this kind?

Looks vaguely reasonable, without looking too much into the details.
I would prefer to have the callback do the errmsg() directly, so that
SlruReportIOError() can do something like

        case SLRU_OPEN_FAILED:
            ereport(ERROR,
                    (errcode_for_file_access(),
                     SlruCtl->errmsg_for_io_error(whatever),
                     errdetail("Could not open file \"%s\": %m.", path)));
            break;

and the callback is something like

static int
xact_errmsg_for_io_error(const void *opaque_data)
{
   TransactionId xid;

   xid = opaque_data ? (*(TransactionId *) opaque_data) : InvalidTransactionId;
   return errmsg("could not access status of transaction %u", xid);
}

We have various errdetail() routines of this kind.

Alternatively, maybe we could report in errmsg() the file operation that
failed, and the XID details etc as part of an error_context_stack
callback.  The error reporting style we're using here is perhaps not
well adapted to the times.

> Should we start a new thread?

I think so, yeah.

-- 
Álvaro Herrera               48°01'N 7°57'E  —  https://www.EnterpriseDB.com/
"¿Qué importan los años?  Lo que realmente importa es comprobar que
a fin de cuentas la mejor edad de la vida es estar vivo"  (Mafalda)



Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Fix partial read handling in pg_upgrade's multixact conversion

  2. Increase timeout in multixid_conversion upgrade test

  3. Improve sanity checks on multixid members length

  4. Clarify comment on multixid offset wraparound check

  5. Never store 0 as the nextMXact

  6. Add runtime checks for bogus multixact offsets

  7. Widen MultiXactOffset to 64 bits

  8. Move pg_multixact SLRU page format definitions to a separate header

  9. Convert confusing macros in multixact.c to static inline functions

  10. Index SLRUs by 64-bit integers rather than by 32-bit integers

  11. Cope with possible failure of the oldest MultiXact to exist.