提交 258174b4 编写于 作者: H Heikki Linnakangas

Need to use the start pointer of a block we read from WAL segment in

the calculation, not the end pointer, as pointed out by Fujii Masao.
上级 e76b4e0d
......@@ -30,7 +30,7 @@
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
......@@ -506,8 +506,8 @@ WalSndKill(int code, Datum arg)
void
XLogRead(char *buf, XLogRecPtr recptr, Size nbytes)
{
XLogRecPtr startRecPtr = recptr;
char path[MAXPGPATH];
uint32 startoff;
uint32 lastRemovedLog;
uint32 lastRemovedSeg;
uint32 log;
......@@ -515,6 +515,7 @@ XLogRead(char *buf, XLogRecPtr recptr, Size nbytes)
while (nbytes > 0)
{
uint32 startoff;
int segbytes;
int readbytes;
......@@ -596,7 +597,7 @@ XLogRead(char *buf, XLogRecPtr recptr, Size nbytes)
* 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))
{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册