pgsql: More cleanup of 'ThisTimeLineID'.

Поиск
Список
Период
Сортировка
От Robert Haas
Тема pgsql: More cleanup of 'ThisTimeLineID'.
Дата
Msg-id E1mkowH-0007vf-33@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
More cleanup of 'ThisTimeLineID'.

In XLogCtlData, rename the structure member ThisTimeLineID to
InsertTimeLineID and update the comments to make clear that it's only
expected to be set after recovery is complete.

In StartupXLOG, replace the local variables ThisTimeLineID and
PrevTimeLineID with new local variables replayTLI and newTLI.  In the
old scheme, ThisTimeLineID was the replay TLI until we created a new
timeline, and after that the replay TLI was in PrevTimeLineID. Now,
replayTLI is the TLI from which we last replayed WAL throughout the
entire function, and newTLI is either that, or the new timeline created
upon promotion.

Remove some misleading comments from the comment block just above where
recoveryTargetTimeLineGoal and friends are declared. It's become
incorrect, not only because ThisTimeLineID as a variable is now gone,
but also because the rmgr code does not care about ThisTimeLineID and
has not since what used to be the TLI field in the page header was
repurposed to store the page checksum.

Add a comment GetFlushRecPtr that it's only supposed to be used in
normal running, and an assertion to verify that this is so.

Per some ideas from Michael Paquier and some of my own. Review by
Michael Paquier also.

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

Branch
------
master

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

Modified Files
--------------
src/backend/access/transam/xlog.c | 125 +++++++++++++++++++-------------------
1 file changed, 62 insertions(+), 63 deletions(-)


В списке pgsql-committers по дате отправления:

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: pgsql: Fix incorrect format placeholders
Следующее
От: Robert Haas
Дата:
Сообщение: pgsql: Fix thinko in assertion in basebackup.c.