pgsql: StartupXLOG: Don't repeatedly disable/enable local xlog insertio - Mailing list pgsql-committers

From Robert Haas
Subject pgsql: StartupXLOG: Don't repeatedly disable/enable local xlog insertio
Date
Msg-id E1mf1CB-0000FM-3j@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
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(-)


pgsql-committers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: pgsql: Clarify the logic in a few places in the new balanced merge code
Next
From: Robert Haas
Date:
Subject: pgsql: Remove useless code from CreateReplicationSlot.