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: Move InitXLogInsert() call from InitXLOGAccess() to BaseInit().
Date: Tue, 16 Nov 2021 14:53:53 +0000
Message-ID: <E1mmzqL-0006zh-Us@gemulon.postgresql.org> (raw)

Move InitXLogInsert() call from InitXLOGAccess() to BaseInit().

At present, there is an undocumented coding rule that you must call
RecoveryInProgress(), or do something else that results in a call
to InitXLogInsert(), before trying to write WAL. Otherwise, the
WAL construction buffers won't be initialized, resulting in
failures.

Since it's not good to rely on a status inquiry function like
RecoveryInProgress() having the side effect of initializing
critical data structures, instead do the initialization eariler,
when the backend first starts up.

Patch by me. Reviewed by Nathan Bossart and Michael Paquier.

Discussion: http://postgr.es/m/CA+TgmoY7b65qRjzHN_tWUk8B4sJqk1vj1d31uepVzmgPnZKeLg@mail.gmail.com

Branch
------
master

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

Modified Files
--------------
src/backend/access/transam/xlog.c | 13 -------------
src/backend/utils/init/postinit.c |  6 ++++++
2 files changed, 6 insertions(+), 13 deletions(-)



Message-ID: <E1mmzqL-0006zh-Us@gemulon.postgresql.org>
Permalink:  ../E1mmzqL-0006zh-Us@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1mmzqL-0006zh-Us@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: Move InitXLogInsert() call from InitXLOGAccess() to BaseInit().
  In-Reply-To: <E1mmzqL-0006zh-Us@gemulon.postgresql.org>
  References: <E1mmzqL-0006zh-Us@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