From eea6720c269ffd27a66892f175e5e6de8a92f729 Mon Sep 17 00:00:00 2001 From: Alexander Korotkov Date: Mon, 20 Apr 2026 21:34:08 +0300 Subject: [PATCH v5 7/7] Document that WAIT FOR LSN is timeline-blind WAIT FOR LSN compares only the numeric LSN and has no notion of which timeline a WAL record belongs to. There are many possible scenarios when timeline-switching can break read-your-writes consistency. The proper analysis and timeline support is possible in the next major release. Yet just document the current behaviour. Reported-by: Xuneng Zhou Author: Alexander Korotkov --- doc/src/sgml/ref/wait_for.sgml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/doc/src/sgml/ref/wait_for.sgml b/doc/src/sgml/ref/wait_for.sgml index 7b403c98dd0..4283dc8a12f 100644 --- a/doc/src/sgml/ref/wait_for.sgml +++ b/doc/src/sgml/ref/wait_for.sgml @@ -256,6 +256,20 @@ WAIT FOR LSN 'lsn' timeline. + + WAIT FOR compares only the numeric + LSN; it has no notion of which timeline a WAL + record belongs to. This matters when a standby continues recovery + across an upstream timeline switch — for example, a cascading + standby whose upstream gets promoted. In that case + WAIT FOR will return success + as soon as the local recovery position passes the numeric + LSN, regardless of which timeline that + LSN belongs to. Applications that need to + confirm the target refers to the expected timeline must validate + the timeline themselves. + + On a standby server, WAIT FOR sessions may be interrupted by recovery conflicts. Some recovery conflicts are -- 2.39.5 (Apple Git-154)