pgsql: Split XLogCtl->LogwrtResult into separate struct members

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Split XLogCtl->LogwrtResult into separate struct members
Date: 2024-04-03 17:56:23
Message-ID: E1rs4qV-000KvC-Am@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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(dot)rupireddyforpostgres(at)gmail(dot)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(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Robert Haas 2024-04-03 20:12:00 pgsql: docs: Demote "Monitoring Disk Usage" from chapter to section.
Previous Message Nathan Bossart 2024-04-03 17:24:20 pgsql: Inline pg_popcount() for small buffers.