GIN stuck in loop during PITR
- From: Andreas Seltenreich <andreas+pg(at)gate450(dot)dyndns(dot)org>
- To: pgsql-hackers(at)postgresql(dot)org
- Subject: GIN stuck in loop during PITR
- Date: Thu, 25 May 2006 21:25:26 +0200
- Message-id: <874pzdsy8p(dot)fsf(at)gate450(dot)dyndns(dot)org>
I'm just experimenting a bit with GIN, and it is occasionally getting
stuck looping in findParents() during WAL replay.
The attached patch seems to fix it. I also had to set ptr->off as
advertised in the comment above the function to avoid triggering
assertions.
GIN isn't fully transparent to me yet, so it is quite likely that I am
missing something...
regards,
andreas
Index: ginbtree.c
===================================================================
RCS file: /projects/cvsroot/pgsql/src/backend/access/gin/ginbtree.c,v
retrieving revision 1.1
diff -c -r1.1 ginbtree.c
*** ginbtree.c 2 May 2006 11:28:54 -0000 1.1
--- ginbtree.c 25 May 2006 18:12:13 -0000
***************
*** 202,208 ****
for(;;) {
buffer = ReadBuffer(btree->index, blkno);
LockBuffer(buffer, GIN_EXCLUSIVE);
! page = BufferGetPage(root->buffer);
if ( GinPageIsLeaf(page) )
elog(ERROR, "Lost path");
--- 202,208 ----
for(;;) {
buffer = ReadBuffer(btree->index, blkno);
LockBuffer(buffer, GIN_EXCLUSIVE);
! page = BufferGetPage(buffer);
if ( GinPageIsLeaf(page) )
elog(ERROR, "Lost path");
***************
*** 224,229 ****
--- 224,230 ----
ptr->blkno = blkno;
ptr->buffer = buffer;
ptr->parent = root; /* it's may be wrong, but in next call we will correct */
+ ptr->off = offset;
stack->parent = ptr;
return;
}
Home |
Main Index |
Thread Index