Skip to content

Commit 5f0ba4a

Browse files
committed
Report WAL flush, not insert, position in replication IDENTIFY_SYSTEM
When beginning streaming replication, the client usually issues the IDENTIFY_SYSTEM command, which used to return the current WAL insert position. That's not suitable for the intended purpose of that field, however. pg_receivexlog uses it to start replication from the reported point, but if it hasn't been flushed to disk yet, it will fail. Change IDENTIFY_SYSTEM to report the flush position instead. Backpatch to 9.1 and above. 9.0 doesn't report any WAL position.
1 parent f0241d6 commit 5f0ba4a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

doc/src/sgml/protocol.sgml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1350,7 +1350,7 @@ The commands accepted in walsender mode are:
13501350
</term>
13511351
<listitem>
13521352
<para>
1353-
Current xlog write location. Useful to get a known location in the
1353+
Current xlog flush location. Useful to get a known location in the
13541354
transaction log where streaming can start.
13551355
</para>
13561356
</listitem>

src/backend/replication/walsender.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ IdentifySystem(void)
259259
logptr = GetStandbyFlushRecPtr();
260260
}
261261
else
262-
logptr = GetInsertRecPtr();
262+
logptr = GetFlushRecPtr();
263263

264264
snprintf(tli, sizeof(tli), "%u", ThisTimeLineID);
265265

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy