mirror of
https://github.com/postgres/postgres.git
synced 2026-05-28 04:35:45 -04:00
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.
This commit is contained in:
parent
e76b4e0ddb
commit
258174b462
1 changed files with 4 additions and 3 deletions
|
|
@ -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))
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue