Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit258174b

Browse files
committed
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.
1 parente76b4e0 commit258174b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

‎src/backend/replication/walsender.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
*
3131
*
3232
* IDENTIFICATION
33-
* $PostgreSQL: pgsql/src/backend/replication/walsender.c,v 1.15 2010/04/1209:52:29 heikki Exp $
33+
* $PostgreSQL: pgsql/src/backend/replication/walsender.c,v 1.16 2010/04/1210:18:50 heikki Exp $
3434
*
3535
*-------------------------------------------------------------------------
3636
*/
@@ -506,15 +506,16 @@ WalSndKill(int code, Datum arg)
506506
void
507507
XLogRead(char*buf,XLogRecPtrrecptr,Sizenbytes)
508508
{
509+
XLogRecPtrstartRecPtr=recptr;
509510
charpath[MAXPGPATH];
510-
uint32startoff;
511511
uint32lastRemovedLog;
512512
uint32lastRemovedSeg;
513513
uint32log;
514514
uint32seg;
515515

516516
while (nbytes>0)
517517
{
518+
uint32startoff;
518519
intsegbytes;
519520
intreadbytes;
520521

@@ -596,7 +597,7 @@ XLogRead(char *buf, XLogRecPtr recptr, Size nbytes)
596597
* already have been overwritten with new WAL records.
597598
*/
598599
XLogGetLastRemoved(&lastRemovedLog,&lastRemovedSeg);
599-
XLByteToPrevSeg(recptr,log,seg);
600+
XLByteToSeg(startRecPtr,log,seg);
600601
if (log<lastRemovedLog||
601602
(log==lastRemovedLog&&seg <=lastRemovedSeg))
602603
{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp