Re: server closed the connection unexpectedly - Mailing list pgsql-general

From Tom Lane
Subject Re: server closed the connection unexpectedly
Date
Msg-id 21455.1160151007@sss.pgh.pa.us
Whole thread Raw
In response to Re: server closed the connection unexpectedly  ("Mark Greenbank" <mark.greenbank@gmail.com>)
List pgsql-general
"Mark Greenbank" <mark.greenbank@gmail.com> writes:
> [ select count(*) from email_queue leads to ]
> LOG:  server process (pid 26548) was terminated by signal 11

If this is repeatable then it probably indicates corrupt data on-disk
(which 7.3.2 is mostly lacking any defenses for).  The trick is to find
and delete the corrupted rows or pages.  You can generally get somewhere
by a process of binary search, ie, find the largest N such that
"select ctid,* from email_queue limit N" doesn't fail.  The last ctid
you can extract this way will be one or two before the (first) bad row.

Given that it's a count(*) that's failing, the problem is probably with
a page or tuple header and not any individual data field, so you might
not have any good recovery option beyond zeroing the whole page
containing the error.  See the mailing list archives for past
discussions of recovering from data corruption for more info.

> The worrying bit (at least to my uneducated eye) is the line:
> LOG:  ReadRecord: record with zero length at D/72C79AD4

That's normal operation, don't worry about it.

            regards, tom lane

pgsql-general by date:

Previous
From: "Brandon Metcalf"
Date:
Subject: Re: Europe/Moscow timezone
Next
From: "Brian J. Erickson"
Date:
Subject: Re: PostgreSQL Database Transfer between machines(again)