Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit ff16b40

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 5ee5bc3 commit ff16b40

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
@@ -1371,7 +1371,7 @@ The commands accepted in walsender mode are:
13711371
</term>
13721372
<listitem>
13731373
<para>
1374-
Current xlog write location. Useful to get a known location in the
1374+
Current xlog flush location. Useful to get a known location in the
13751375
transaction log where streaming can start.
13761376
</para>
13771377
</listitem>

src/backend/replication/walsender.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ IdentifySystem(void)
316316
logptr = GetStandbyFlushRecPtr();
317317
}
318318
else
319-
logptr = GetInsertRecPtr();
319+
logptr = GetFlushRecPtr();
320320

321321
snprintf(tli, sizeof(tli), "%u", ThisTimeLineID);
322322

0 commit comments

Comments
 (0)