pgsql: Delay reading timeline history file until it's fetched from mast

Поиск
Список
Период
Сортировка
От Heikki Linnakangas
Тема pgsql: Delay reading timeline history file until it's fetched from mast
Дата
Msg-id E1Tqp6r-00025b-Dv@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Delay reading timeline history file until it's fetched from master.

Streaming replication can fetch any missing timeline history files from the
master, but recovery would read the timeline history file for the target
timeline before reading the checkpoint record, and before walreceiver has
had a chance to fetch it from the master. Delay reading it, and the sanity
checks involving timeline history, until after reading the checkpoint
record.

There is at least one scenario where this makes a difference: if you take
a base backup from a standby server right after a timeline switch, the
WAL segment containing the initial checkpoint record will begin with an
older timeline ID. Without the timeline history file, recovering that file
will fail as the older timeline ID is not recognized to be an ancestor of
the target timeline. If you try to recover from such a backup, using only
streaming replication to fetch the WAL, this patch is required for that to
work.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/ee994272ca50f70b53074f0febaec97e28f83c4e

Modified Files
--------------
src/backend/access/transam/xlog.c     |  140 ++++++++++++++++++++------------
src/backend/replication/walreceiver.c |    5 +-
2 files changed, 90 insertions(+), 55 deletions(-)


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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: pgsql: Adjust a few pg_upgrade functions to return void.
Следующее
От: Heikki Linnakangas
Дата:
Сообщение: pgsql: Tolerate timeline switches while "pg_basebackup -X fetch" is run