pgsql: Fix corner case failure of new standby to follow new primary.
От | Robert Haas |
---|---|
Тема | pgsql: Fix corner case failure of new standby to follow new primary. |
Дата | |
Msg-id | E1lr53M-0006Lz-8s@gemulon.postgresql.org обсуждение исходный текст |
Список | pgsql-committers |
Fix corner case failure of new standby to follow new primary. This only happens if (1) the new standby has no WAL available locally, (2) the new standby is starting from the old timeline, (3) the promotion happened in the WAL segment from which the new standby is starting, (4) the timeline history file for the new timeline is available from the archive but the WAL files for are not (i.e. this is a race), (5) the WAL files for the new timeline are available via streaming, and (6) recovery_target_timeline='latest'. Commit ee994272ca50f70b53074f0febaec97e28f83c4e introduced this logic and was an improvement over the previous code, but it mishandled this case. If recovery_target_timeline='latest' and restore_command is set, validateRecoveryParameters() can change recoveryTargetTLI to be different from receiveTLI. If streaming is then tried afterward, expectedTLEs gets initialized with the history of the wrong timeline. It's supposed to be a list of entries explaining how to get to the target timeline, but in this case it ends up with a list of entries explaining how to get to the new standby's original timeline, which isn't right. Dilip Kumar and Robert Haas, reviewed by Kyotaro Horiguchi. Discussion: http://postgr.es/m/CAFiTN-sE-jr=LB8jQuxeqikd-Ux+jHiXyh4YDiZMPedgQKup0g@mail.gmail.com Branch ------ REL9_6_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/6eb5b9ae39176a7d40003b4c2e9ca22e6b205def Modified Files -------------- src/backend/access/transam/xlog.c | 10 ++- src/test/recovery/t/025_stuck_on_old_timeline.pl | 107 +++++++++++++++++++++++ src/test/recovery/t/cp_history_files | 10 +++ 3 files changed, 126 insertions(+), 1 deletion(-)
В списке pgsql-committers по дате отправления: