pgsql: Avoid assertion failure with targeted recovery in standby mode.

Поиск
Список
Период
Сортировка
От Fujii Masao
Тема pgsql: Avoid assertion failure with targeted recovery in standby mode.
Дата
Msg-id E1jBC9R-00057E-D1@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Avoid assertion failure with targeted recovery in standby mode.

At the end of recovery, standby mode is turned off to re-fetch the last
valid record from archive or pg_wal. Previously, if recovery target was
reached and standby mode was turned off while the current WAL source
was stream, recovery could try to retrieve WAL file containing the last
valid record unexpectedly from stream even though not in standby mode.
This caused an assertion failure. That is, the assertion test confirms that
WAL file should not be retrieved from stream if standby mode is not true.

This commit moves back the current WAL source to archive if it's stream
even though not in standby mode, to avoid that assertion failure.

This issue doesn't cause the server to crash when built with assertion
disabled. In this case, the attempt to retrieve WAL file from stream not
in standby mode just fails. And then recovery tries to retrieve WAL file
from archive or pg_wal.

Back-patch to all supported branches.

Author: Kyotaro Horiguchi
Reviewed-by: Fujii Masao
Discussion: https://postgr.es/m/20200227.124830.2197604521555566121.horikyota.ntt@gmail.com

Branch
------
REL_11_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/500fe161edd0eee20fb12365609f0db215db34f7

Modified Files
--------------
src/backend/access/transam/xlog.c | 23 ++++++++++++++++++++++-
1 file changed, 22 insertions(+), 1 deletion(-)


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

Предыдущее
От: Fujii Masao
Дата:
Сообщение: pgsql: Avoid assertion failure with targeted recovery in standby mode.
Следующее
От: Fujii Masao
Дата:
Сообщение: pgsql: Avoid assertion failure with targeted recovery in standby mode.