*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/replication/walsender.c,v 1.15 2010/04/12 09:52:29 heikki Exp $
+ * $PostgreSQL: pgsql/src/backend/replication/walsender.c,v 1.16 2010/04/12 10:18:50 heikki Exp $
*
*-------------------------------------------------------------------------
*/
void
XLogRead(char *buf, XLogRecPtr recptr, Size nbytes)
{
+ XLogRecPtr startRecPtr = recptr;
char path[MAXPGPATH];
- uint32 startoff;
uint32 lastRemovedLog;
uint32 lastRemovedSeg;
uint32 log;
while (nbytes > 0)
{
+ uint32 startoff;
int segbytes;
int readbytes;
* already have been overwritten with new WAL records.
*/
XLogGetLastRemoved(&lastRemovedLog, &lastRemovedSeg);
- XLByteToPrevSeg(recptr, log, seg);
+ XLByteToSeg(startRecPtr, log, seg);
if (log < lastRemovedLog ||
(log == lastRemovedLog && seg <= lastRemovedSeg))
{