Обсуждение: pgsql: Move InitXLogInsert() call from InitXLOGAccess() to BaseInit().

Поиск
Список
Период
Сортировка

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

От
Robert Haas
Дата:
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(-)