[PATCH] pg_receivexlog: fixed to work with logical segno > 0 - Mailing list pgsql-hackers

From Mika Eloranta
Subject [PATCH] pg_receivexlog: fixed to work with logical segno > 0
Date
Msg-id 1383298950-1741-1-git-send-email-mel@ohmu.fi
Whole thread Raw
Responses Re: [PATCH] pg_receivexlog: fixed to work with logical segno > 0  (Heikki Linnakangas <hlinnakangas@vmware.com>)
List pgsql-hackers
pg_receivexlog calculated the xlog segment number incorrectly
when started after the previous instance was interrupted.

Resuming streaming only worked when the physical wal segment
counter was zero, i.e. for the first 256 segments or so.
---src/bin/pg_basebackup/pg_receivexlog.c | 2 +-1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/bin/pg_basebackup/pg_receivexlog.c b/src/bin/pg_basebackup/pg_receivexlog.c
index 031ec1a..6f9fcf4 100644
--- a/src/bin/pg_basebackup/pg_receivexlog.c
+++ b/src/bin/pg_basebackup/pg_receivexlog.c
@@ -171,7 +171,7 @@ FindStreamingStart(uint32 *tli)                    progname, dirent->d_name);
disconnect_and_exit(1);       }
 
-        segno = ((uint64) log) << 32 | seg;
+        segno = (((uint64) log) << 8) | seg;        /*         * Check that the segment has the right size, if it's
supposedto be
 
-- 
1.8.0.1




pgsql-hackers by date:

Previous
From: Craig Ringer
Date:
Subject: Re: How should row-security affects ON UPDATE RESTRICT / CASCADE ?
Next
From: "Etsuro Fujita"
Date:
Subject: Re: Show lossy heap block info in EXPLAIN ANALYZE for bitmap heap scan