pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Fix corner case failure of new standby to follow new primary.
6+ messages / 1 participants
[nested] [flat]

* pgsql: Fix corner case failure of new standby to follow new primary.
@ 2021-06-09 20:43  Robert Haas <rhaas@postgresql.org>
  0 siblings, 0 replies; 6+ messages in thread

From: Robert Haas @ 2021-06-09 20:43 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/caba8f0d43fb679c6f9643456080408a6bc370e8

Modified Files
--------------
src/backend/access/transam/xlog.c                | 10 ++-
src/test/recovery/t/025_stuck_on_old_timeline.pl | 96 ++++++++++++++++++++++++
src/test/recovery/t/cp_history_files             | 10 +++
3 files changed, 115 insertions(+), 1 deletion(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Fix corner case failure of new standby to follow new primary.
@ 2021-06-09 20:43  Robert Haas <rhaas@postgresql.org>
  0 siblings, 0 replies; 6+ messages in thread

From: Robert Haas @ 2021-06-09 20:43 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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
------
REL_13_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/0826564292156762d32c183c6708c94564fcad1c

Modified Files
--------------
src/backend/access/transam/xlog.c                | 10 ++-
src/test/recovery/t/025_stuck_on_old_timeline.pl | 96 ++++++++++++++++++++++++
src/test/recovery/t/cp_history_files             | 10 +++
3 files changed, 115 insertions(+), 1 deletion(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Fix corner case failure of new standby to follow new primary.
@ 2021-06-09 20:43  Robert Haas <rhaas@postgresql.org>
  0 siblings, 0 replies; 6+ messages in thread

From: Robert Haas @ 2021-06-09 20:43 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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
------
REL_12_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/5d950c721d38ff81913ecae6f75d5ccea904bd8e

Modified Files
--------------
src/backend/access/transam/xlog.c                | 10 ++-
src/test/recovery/t/025_stuck_on_old_timeline.pl | 96 ++++++++++++++++++++++++
src/test/recovery/t/cp_history_files             | 10 +++
3 files changed, 115 insertions(+), 1 deletion(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Fix corner case failure of new standby to follow new primary.
@ 2021-06-09 20:43  Robert Haas <rhaas@postgresql.org>
  0 siblings, 0 replies; 6+ messages in thread

From: Robert Haas @ 2021-06-09 20:43 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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
------
REL_11_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/ca158c168ea381ac54aab3e7a3c1239747ee4a7f

Modified Files
--------------
src/backend/access/transam/xlog.c                | 10 ++-
src/test/recovery/t/025_stuck_on_old_timeline.pl | 96 ++++++++++++++++++++++++
src/test/recovery/t/cp_history_files             | 10 +++
3 files changed, 115 insertions(+), 1 deletion(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Fix corner case failure of new standby to follow new primary.
@ 2021-06-09 20:43  Robert Haas <rhaas@postgresql.org>
  0 siblings, 0 replies; 6+ messages in thread

From: Robert Haas @ 2021-06-09 20:43 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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
------
REL_10_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/31bda6a22ad11069b1e5f3a206262ee800303e51

Modified Files
--------------
src/backend/access/transam/xlog.c                | 10 ++-
src/test/recovery/t/025_stuck_on_old_timeline.pl | 96 ++++++++++++++++++++++++
src/test/recovery/t/cp_history_files             | 10 +++
3 files changed, 115 insertions(+), 1 deletion(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Fix corner case failure of new standby to follow new primary.
@ 2021-06-09 20:43  Robert Haas <rhaas@postgresql.org>
  0 siblings, 0 replies; 6+ messages in thread

From: Robert Haas @ 2021-06-09 20:43 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread


end of thread, other threads:[~2021-06-09 20:43 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-06-09 20:43 pgsql: Fix corner case failure of new standby to follow new primary. Robert Haas <rhaas@postgresql.org>
2021-06-09 20:43 pgsql: Fix corner case failure of new standby to follow new primary. Robert Haas <rhaas@postgresql.org>
2021-06-09 20:43 pgsql: Fix corner case failure of new standby to follow new primary. Robert Haas <rhaas@postgresql.org>
2021-06-09 20:43 pgsql: Fix corner case failure of new standby to follow new primary. Robert Haas <rhaas@postgresql.org>
2021-06-09 20:43 pgsql: Fix corner case failure of new standby to follow new primary. Robert Haas <rhaas@postgresql.org>
2021-06-09 20:43 pgsql: Fix corner case failure of new standby to follow new primary. Robert Haas <rhaas@postgresql.org>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox