Received: from maia.hub.org (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id CA94C635A1E for ; Thu, 22 Apr 2010 13:56:20 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 28426-02-7 for ; Thu, 22 Apr 2010 16:56:08 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from smadev.internal.net (host3.dynacom.ondsl.gr [62.103.35.211]) by mail.postgresql.org (Postfix) with ESMTP id B713C638173 for ; Thu, 22 Apr 2010 12:18:55 -0300 (ADT) Received: from smadev.internal.net (localhost [127.0.0.1]) by smadev.internal.net (8.14.2/8.14.2) with ESMTP id o3MFIqhl022847; Thu, 22 Apr 2010 18:18:52 +0300 (EEST) (envelope-from achill@matrix.gatewaynet.com) Received: from localhost (localhost [[UNIX: localhost]]) by smadev.internal.net (8.14.2/8.14.2/Submit) id o3MFIqAN022846; Thu, 22 Apr 2010 18:18:52 +0300 (EEST) (envelope-from achill@matrix.gatewaynet.com) From: Achilleas Mantzios Organization: Dynacom Tankers Mgmt To: =?utf-8?q?C=C3=A9dric_Villemain?= Subject: Re: pgsql 8.3.3 "Invalid page header" leads to "FATAL: segment too big" Date: Thu, 22 Apr 2010 17:18:51 +0200 User-Agent: KMail/1.9.7 Cc: "pgsql-admin@postgresql.org" References: <201004221516.08729.achill@matrix.gatewaynet.com> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <201004221818.51840.achill@matrix.gatewaynet.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.836 tagged_above=-10 required=5 tests=AWL=0.064, BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201004/305 X-Sequence-Number: 34399 =CE=A3=CF=84=CE=B9=CF=82 Thursday 22 April 2010 16:53:05 =CE=BF/=CE=B7 C=C3= =A9dric Villemain =CE=AD=CE=B3=CF=81=CE=B1=CF=88=CE=B5: > 2010/4/22 Achilleas Mantzios : > > Hello, > > i have this serious problem in one of our remote vessels. (comm is done= by minicom to the remote satelite modem) > > I think that this server was under some sort of constant resets or hard= ware failures. > > Initially,i had this problem: > > ERROR: =C2=A0invalid page header in block 672720 of relation "pg_toast_= 125716009" > > > > This toast table corresponds to a table named "mail_message", > > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Table "public.mail_message" > > =C2=A0Column =C2=A0 | =C2=A0 =C2=A0 =C2=A0 Type =C2=A0 =C2=A0 =C2=A0 = =C2=A0| =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 Modifiers > > -----------+-------------------+---------------------------------------= =2D------------------- > > =C2=A0msgno =C2=A0 =C2=A0 | mail_msgno_domain | not null default nextva= l('mail_msgno_sequence'::regclass) > > =C2=A0msgsource | bytea =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 | > > Indexes: > > =C2=A0 =C2=A0"mail_message_key" PRIMARY KEY, btree (msgno) > > > > (obviously the TOAST table serves the msgsource varlena) the contents o= f which is not of vital importance. > > I tried, REINDEXING, with no success, and after that, i tried resetting= the said block on disk as per this > > suggestion by Tom here: http://old.nabble.com/invalid-page-header-td119= 81154.html > > > > i found the oid of the table: > > SELECT tableoid,1 from pg_toast.pg_toast_125716009 order by chunk_id LI= MIT 1 > > =C2=A0tableoid =C2=A0| ?column? > > -----------+---------- > > =C2=A0125716013 | =C2=A0 =C2=A0 =C2=A0 =C2=A01 > > > > (and just to verify) > > SELECT relname from pg_class where oid=3D125716013; > > =C2=A0 =C2=A0 =C2=A0relname > > -------------------- > > =C2=A0pg_toast_125716009 > > > > Then i did: (as i said i do not need the contents of msgsource - yet th= e contents of msgno are vital) > > dd if=3D/dev/zero of=3D/usr/local/var/lib/pgsql/data/base/125714957/125= 716013 seek=3D672720 bs=3D8192 count=3D1 >=20 > segment have 1.1GB size maximum. You have to catch in what segment the > faulty block is, and reajust the block value from the error report to > the real one in the good segment. >=20 Thanx, Taking a look at /usr/local/src/postgresql-8.3.3/src/backend/storage/smgr/m= d.c i see the the error comes from function mdnblocks if (nblocks > ((BlockNumber) RELSEG_SIZE)) elog(FATAL, "segment too big"); That means, that some segment file is bigger than RELSEG_SIZE At least in my system: #define BLCKSZ 8192 #define RELSEG_SIZE (0x40000000 / BLCKSZ) So, any segment file cannot be bigger than RELSEG_SIZE blocks (or 2^30 byte= s =3D 1GB) Currently i dont have any access to the machine but tomorrow i will check t= he file sizes. Can anyone shed some light as to some method of identifying all the segment= files of a table? The first one has the same name as the tableoid.=20 How about the subsequent segments? > > > > However, after that, unfortunately i get constant postgresql server res= tarts with: > > FATAL: =C2=A0segment too big > > server closed the connection unexpectedly > > =C2=A0 =C2=A0 =C2=A0 =C2=A0This probably means the server terminated ab= normally > > =C2=A0 =C2=A0 =C2=A0 =C2=A0before or while processing the request. > > The connection to the server was lost. Attempting reset: Succeeded. > > > > Is there anything i can do to savage the situation? > > > > (one of) the hard part here is that i dont have neither physical nor ne= twork access to the server > > (only ultra expensive unreliable satellite comms) > > > > Thanks for any hints... > > > > -- > > Achilleas Mantzios > > > > -- > > Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) > > To make changes to your subscription: > > http://www.postgresql.org/mailpref/pgsql-admin > > >=20 >=20 >=20 =2D-=20 Achilleas Mantzios