From dbc6fcf35d4fa95ea2fd4d7bbd9e56be560c1ef9 Mon Sep 17 00:00:00 2001
From: Magnus Hagander <magnus@hagander.net>
Date: Wed, 4 Jul 2012 15:13:09 +0200
Subject: [PATCH] Set the write location in the pg_receivexlog status messages

This makes it possible for the master to track how much data has
actually been written my pg_receivexlog - and not just how much
has been sent towards it.
---
 src/bin/pg_basebackup/receivelog.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/bin/pg_basebackup/receivelog.c b/src/bin/pg_basebackup/receivelog.c
index 064315f8dbc..e6c2dec6ef2 100644
--- a/src/bin/pg_basebackup/receivelog.c
+++ b/src/bin/pg_basebackup/receivelog.c
@@ -359,7 +359,7 @@ ReceiveXlogStream(PGconn *conn, XLogRecPtr startpos, uint32 timeline, char *sysi
 			char		replybuf[sizeof(StandbyReplyMessage) + 1];
 			StandbyReplyMessage *replymsg = (StandbyReplyMessage *) (replybuf + 1);
 
-			replymsg->write = InvalidXLogRecPtr;
+			replymsg->write = blockpos;
 			replymsg->flush = InvalidXLogRecPtr;
 			replymsg->apply = InvalidXLogRecPtr;
 			replymsg->sendTime = now;
-- 
GitLab