pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Robert Haas <rhaas@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: StartupXLOG: Don't repeatedly disable/enable local xlog insertio
Date: Mon, 25 Oct 2021 14:43:27 +0000
Message-ID: <E1mf1CB-0000FM-3j@gemulon.postgresql.org> (raw)

StartupXLOG: Don't repeatedly disable/enable local xlog insertion.

All the code that runs in the startup process to write WAL records
before that's allowed generally is now consecutive, so there's no
reason to shut the facility to write WAL locally off and then turn
it on again three times in a row.

Unfortunately, this requires a slight kludge in the checkpointer,
which needs to separately enable writing WAL in order to write the
checkpoint record. Because that code might run in the same process
as StartupXLOG() if we are in single-user mode, we must save/restore
the state of the LocalXLogInsertAllowed flag. Hopefully, we'll be
able to eliminate this wart in further refactoring, but it's
not too bad anyway.

Amul Sul, with modifications by me.

Discussion: http://postgr.es/m/CAAJ_b97fysj6sRSQEfOHj-y8Jfd5uPqOgO74qast89B4WfD+TA@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/18e0913a420349d373cfd8e45b91b4777501fb74

Modified Files
--------------
src/backend/access/transam/xlog.c | 23 ++++++++++++-----------
1 file changed, 12 insertions(+), 11 deletions(-)



Message-ID: <E1mf1CB-0000FM-3j@gemulon.postgresql.org>
Permalink:  ../E1mf1CB-0000FM-3j@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1mf1CB-0000FM-3j@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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: rhaas@postgresql.org
  Subject: Re: pgsql: StartupXLOG: Don't repeatedly disable/enable local xlog insertio
  In-Reply-To: <E1mf1CB-0000FM-3j@gemulon.postgresql.org>
  References: <E1mf1CB-0000FM-3j@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