pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Split XLogCtl->LogwrtResult into separate struct members
Date: Wed, 03 Apr 2024 17:56:23 +0000
Message-ID: <E1rs4qV-000KvC-Am@gemulon.postgresql.org> (raw)

Split XLogCtl->LogwrtResult into separate struct members

After this change we have XLogCtl->logWriteResult and ->logFlushResult.
There's no functional change, other than the fact that the assignment
from shared memory to local is no longer done via struct assignment, but
instead using a macro that copies each member separately.

The current representation is inconvenient going forward; notably, we
would like to add a new member "Copy" (to keep track of the last
position copied into WAL buffers), so the symmetry between the values in
shared memory vs. those in local would be lost.

This also gives us freedom to later change the concurrency model for the
values in shared memory: we can make them use atomics instead of relying
on the info_lck spinlock.

Reviewed-by: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Discussion: https://postgr.es/m/202404031119.cd2kugjk2vho@alvherre.pgsql

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/c9920a9068eac2e6c8fb34988d18c0b42b9bf811

Modified Files
--------------
src/backend/access/transam/xlog.c | 59 +++++++++++++++++++++++----------------
1 file changed, 35 insertions(+), 24 deletions(-)



Message-ID: <E1rs4qV-000KvC-Am@gemulon.postgresql.org>
Permalink:  ../E1rs4qV-000KvC-Am@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1rs4qV-000KvC-Am@gemulon.postgresql.org

 · 

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-committers@postgresql.org
  Cc: alvherre@alvh.no-ip.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Split XLogCtl->LogwrtResult into separate struct members
  In-Reply-To: <E1rs4qV-000KvC-Am@gemulon.postgresql.org>

* 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