pgsql: Fix assert failure at end of recovery, broken by XLogInsert scal

Поиск
Список
Период
Сортировка
От Heikki Linnakangas
Тема pgsql: Fix assert failure at end of recovery, broken by XLogInsert scal
Дата
Msg-id E1UzYGc-0001jG-MM@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Fix assert failure at end of recovery, broken by XLogInsert scaling patch.

Initialization of the first XLOG buffer at end-of-recovery was broken for
the case that the last read WAL record ended at a page boundary. Instead of
trying to copy the last full xlog page to the buffer cache in that case,
just set shared state so that the next page is initialized when the first
WAL record after startup is inserted. (that's what we did in earlier
version, too)

To make the shared state required for that case less surprising, replace the
XLogCtl->curridx variable, which was the index of the latest initialized
buffer, with an XLogRecPtr of how far the buffers have been initialized.
That also allows us to get rid of the XLogRecEndPtrToBufIdx macro.

While we're at it, make a similar change for XLogCtl->Write.curridx, getting
rid of that variable and calculating the next buffer to write from
XLogCtl->LogwrtResult instead.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/59c02a36f0ef317958b2d14313b5c8e41cfd9be6

Modified Files
--------------
src/backend/access/transam/xlog.c |  111 +++++++++++++++----------------------
1 file changed, 45 insertions(+), 66 deletions(-)


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

Предыдущее
От: Heikki Linnakangas
Дата:
Сообщение: pgsql: Fix end-of-loop optimization in pglz_find_match() function.
Следующее
От: Heikki Linnakangas
Дата:
Сообщение: pgsql: Fix variable names mentioned in comment to match the code.