pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: Stefan Froehlich <postgresql@froehlich.priv.at>
To: pgsql-general@postgresql.org
Subject: Re: server process (PID 2964738) was terminated by signal 11: Segmentation fault
Date: Mon, 07 Nov 2022 12:19:35 +0100
Message-ID: <0fb331d6fa4743a89070e092c62020ffee3020a5.camel@cybertec.at> (raw)
In-Reply-To: <20221107101716.GA20949@static.231.150.9.176.clients.your-server.de>
References: <20221106111820.GA26442@static.231.150.9.176.clients.your-server.de>
	<3007238.1667743988@sss.pgh.pa.us>
	<20221106143544.GA4940@static.231.150.9.176.clients.your-server.de>
	<3010779.1667746112@sss.pgh.pa.us>
	<20221107101716.GA20949@static.231.150.9.176.clients.your-server.de>

On Mon, 2022-11-07 at 11:17 +0100, Stefan Froehlich wrote:
> On Sun, Nov 06, 2022 at 09:48:32AM -0500, Tom Lane wrote:
> > Stefan Froehlich <postgresql@froehlich.priv.at> writes:
> > > > # create extension amcheck;
> > > > # select oid, relname from pg_class where relname ='faultytablename_pkey';
> > > > [returns oid 537203]
> > > > # select bt_index_check(537203, true);
> > > > server closed the connection unexpectedly
> 
> > Another idea is to try using contrib/pageinspect to examine each
> > page of the table.  Its output is just gobbledegook to most
> > people, but there's a good chance it'd fail visibly on the
> > corrupted page(s).
> 
> Fortunately I was able to identify a window of 100 records (out of
> 25 mio.) containing all the errors. After deleting and re-inserting
> those records everything seems to be ok (at least, pg_dump and
> "reindex database" work without errors).

Don't continue to work with that cluster even if everything seems OK now.
"pg_dumpall" and restore to a new cluster on good hardware.

> I suspect a bad RAM module to be the root of the problems. We'll
> see.
> 
> Side question: If it is possible to simply delete and create such
> records is it necessary that the server *core* *dumps*? There could
> be a switch adding additional safety (at the cost of performance)
> which would make troubleshooting not only much faster but
> non-invasive for the other databases on the same server as well.

Crashing is never nice.  On the other hand, adding checks and error
messages for conditions that are always true in a correct block cost
performance.  I can't tell about your specific case, but a build
of PostgreSQL --enable-cassert has assitional checks in the code.
That will still crash, but the log will show what condition was violated.

Yours,
Laurenz Albe





view thread (13+ messages)  latest in thread

Message-ID: <0fb331d6fa4743a89070e092c62020ffee3020a5.camel@cybertec.at>
Permalink:  ../0fb331d6fa4743a89070e092c62020ffee3020a5.camel@cybertec.at/
Also on:    postgresql.org/message-id/0fb331d6fa4743a89070e092c62020ffee3020a5.camel@cybertec.at

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: laurenz.albe@cybertec.at, postgresql@froehlich.priv.at
  Subject: Re: server process (PID 2964738) was terminated by signal 11: Segmentation fault
  In-Reply-To: <0fb331d6fa4743a89070e092c62020ffee3020a5.camel@cybertec.at>
  References: <20221106111820.GA26442@static.231.150.9.176.clients.your-server.de> <3007238.1667743988@sss.pgh.pa.us> <20221106143544.GA4940@static.231.150.9.176.clients.your-server.de> <3010779.1667746112@sss.pgh.pa.us> <20221107101716.GA20949@static.231.150.9.176.clients.your-server.de> <0fb331d6fa4743a89070e092c62020ffee3020a5.camel@cybertec.at>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox