pgsql: Move InitXLogInsert() call from InitXLOGAccess() to BaseInit(). - Mailing list pgsql-committers

From Robert Haas
Subject pgsql: Move InitXLogInsert() call from InitXLOGAccess() to BaseInit().
Date
Msg-id E1mmzqL-0006zh-Us@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
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(-)


pgsql-committers by date:

Previous
From: Amit Kapila
Date:
Subject: pgsql: Invalidate relcache when changing REPLICA IDENTITY index.
Next
From: Alvaro Herrera
Date:
Subject: pgsql: Fix headerscheck failure in replication/worker_internal.h