BUG in XLogRecordAssemble
hi,
I found the code in 'backend/access/transam/xloginsert.c' as that:
XLogRecordAssemble:
if (prev_regbuf && RelFileNodeEquals(regbuf->rnode, prev_regbuf->rnode))
{
samerel = true;
bkpb.fork_flags |= BKPBLOCK_SAME_REL;
prev_regbuf = regbuf;
}
else
samerel = false;
There is the only place that prev_regbuf is assigned, so prev_regbuf will never be assigned.
The patch will fix it, Thanks.
Zhang Zq
Attachments:
XLogRecordAssemble.patchapplication/octet-stream; name=XLogRecordAssemble.patchDownload
*** a/src/backend/access/transam/xloginsert.c
--- b/src/backend/access/transam/xloginsert.c
***************
*** 667,676 **** XLogRecordAssemble(RmgrId rmid, uint8 info,
{
samerel = true;
bkpb.fork_flags |= BKPBLOCK_SAME_REL;
- prev_regbuf = regbuf;
}
else
samerel = false;
/* Ok, copy the header to the scratch buffer */
memcpy(scratch, &bkpb, SizeOfXLogRecordBlockHeader);
--- 667,676 ----
{
samerel = true;
bkpb.fork_flags |= BKPBLOCK_SAME_REL;
}
else
samerel = false;
+ prev_regbuf = regbuf;
/* Ok, copy the header to the scratch buffer */
memcpy(scratch, &bkpb, SizeOfXLogRecordBlockHeader);
On Tue, May 5, 2015 at 1:04 AM, Zhang Zq <zqzhangmail@163.com> wrote:
There is the only place that prev_regbuf is assigned, so prev_regbuf will
never be assigned.
The patch will fix it, Thanks.
Indeed. I think you are right. We never set prev_regbuf with the current code.
--
Michael
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
On 05/04/2015 07:04 PM, Zhang Zq wrote:
hi,
I found the code in 'backend/access/transam/xloginsert.c' as that:
XLogRecordAssemble:
if (prev_regbuf && RelFileNodeEquals(regbuf->rnode, prev_regbuf->rnode))
{
samerel = true;
bkpb.fork_flags |= BKPBLOCK_SAME_REL;
prev_regbuf = regbuf;
}
else
samerel = false;There is the only place that prev_regbuf is assigned, so prev_regbuf will never be assigned.
The patch will fix it, Thanks.
Thanks, good catch! Committed.
- Heikki
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers