pgsql: Remove files signaling a standby promotion request at postmaster

Поиск
Список
Период
Сортировка
От Fujii Masao
Тема pgsql: Remove files signaling a standby promotion request at postmaster
Дата
Msg-id E1ZZg1M-0007r9-3o@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Remove files signaling a standby promotion request at postmaster startup

This commit makes postmaster forcibly remove the files signaling
a standby promotion request. Otherwise, the existence of those files
can trigger a promotion too early, whether a user wants that or not.

This removal of files is usually unnecessary because they can exist
only during a few moments during a standby promotion. However
there is a race condition: if pg_ctl promote is executed and creates
the files during a promotion, the files can stay around even after
the server is brought up to new master. Then, if new standby starts
by using the backup taken from that master, the files can exist
at the server startup and should be removed in order to avoid
an unexpected promotion.

Back-patch to 9.1 where promote signal file was introduced.

Problem reported by Feike Steenbergen.
Original patch by Michael Paquier, modified by me.

Discussion: 20150528100705.4686.91426@wrigleys.postgresql.org

Branch
------
REL9_1_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/60fe73b79ce8a65ee4eda34a2f4f204a95081603

Modified Files
--------------
src/backend/access/transam/xlog.c   |    9 +++++++++
src/backend/postmaster/postmaster.c |   21 +++++++++++++++++++++
src/include/access/xlog.h           |    1 +
3 files changed, 31 insertions(+)


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

Предыдущее
От: Fujii Masao
Дата:
Сообщение: pgsql: Remove files signaling a standby promotion request at postmaster
Следующее
От: Fujii Masao
Дата:
Сообщение: pgsql: Remove files signaling a standby promotion request at postmaster