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: 2006-05-25 19:25:26
Message-ID: 874pzdsy8p.fsf@gate450.dyndns.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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;
}

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Larry Rosenman 2006-05-25 20:08:35 Re: Gborg and pgfoundry
Previous Message Jeremy Drake 2006-05-25 19:05:16 Re: 8.1.4 build failure on ICC 9.1