Re: PANIC: heap_update_redo: no block - Mailing list pgsql-general

From Qingqing Zhou
Subject Re: PANIC: heap_update_redo: no block
Date
Msg-id dvohju$gaf$1@news.hub.org
Whole thread Raw
In response to PANIC: heap_update_redo: no block  ("Alex bahdushka" <bahdushka@gmail.com>)
Responses Re: PANIC: heap_update_redo: no block  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
""Alex bahdushka"" <bahdushka@gmail.com> wrote
>
> Hrm... well i obviously have restored the database by now (using
> pg_resetxlog; pg_dump; initdb; pg_restore).  However i did make a
> backup of the broken directory before I created the new database.  If
> anyone has any thing they would like me to try to possibly help track
> down this possible bug.  I would be more than glad to do it.
>

pg_resetxlog is the last resort to "avoid" the real problem. Once you reset
it, then the xlog after that some offset will not get replayed (so the
problem disappered) and possibly some data get lost :-(.

Can you patch the heap/heapam.c/heap_xlog_update() like this:

- elog(PANIC, "heap_update_redo: no block");
+ elog(PANIC, "heap_update_redo: no block: target block: %u, relation
length: %u",
+    ItemPointerGetBlockNumber(&(xlrec->target.tid)),
+    RelationGetNumberOfBlocks(reln));

And restart your database to see what's the output?

Regards,
Qingqing



pgsql-general by date:

Previous
From: "Murali K. Maddali"
Date:
Subject: Re: xml output.
Next
From: Martijn van Oosterhout
Date:
Subject: Re: What's a good default encoding?