Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Wcccm-0006YZ-Nn for pgsql-bugs@arkaria.postgresql.org; Tue, 22 Apr 2014 15:28:44 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Wcccm-0005Au-66 for pgsql-bugs@arkaria.postgresql.org; Tue, 22 Apr 2014 15:28:44 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Wcccl-0005Ao-DU for pgsql-bugs@postgresql.org; Tue, 22 Apr 2014 15:28:43 +0000 Received: from bay0-omc1-s6.bay0.hotmail.com ([65.54.190.17]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Wccci-0003Ee-6A for pgsql-bugs@postgresql.org; Tue, 22 Apr 2014 15:28:42 +0000 Received: from BAY172-W52 ([65.54.190.60]) by bay0-omc1-s6.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.4675); Tue, 22 Apr 2014 08:28:39 -0700 X-TMN: [8ROb/Ktmux0Bpz6Yv9W65a2oGb7QRVUT] X-Originating-Email: [lukecoldiron@hotmail.com] Message-ID: Content-Type: multipart/alternative; boundary="_b26fe4db-51b4-4e13-b8ce-d7a2ea5e87b0_" From: Luke Coldiron To: Matheus de Oliveira CC: "pgsql-bugs@postgresql.org" Subject: Re: BUG #10095: primary key corruption Date: Tue, 22 Apr 2014 08:28:39 -0700 Importance: Normal In-Reply-To: References: <20140421200838.2714.47552@wrigleys.postgresql.org>, MIME-Version: 1.0 X-OriginalArrivalTime: 22 Apr 2014 15:28:39.0191 (UTC) FILETIME=[8906D270:01CF5E3F] X-Pg-Spam-Score: -2.5 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org --_b26fe4db-51b4-4e13-b8ce-d7a2ea5e87b0_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable On Mon=2C Apr 21=2C 2014 at 5:08 PM=2C wrote: =0A= =0A= =0A= ERROR: could not read block 0 in file "base/16407/41243": read only 0 of =0A= 8192 bytes =0A= Is this server a slave? Or has it been at some point (and now promoted to m= aster)? It is not a slave server nor has it been at any point in time. =0A= =0A= =0A= When I look on the filesystem the "base/16407/41243" file is zero bytes. =0A= When I lookup the object name that is currupt via select relname from =0A= pg_class where relfilenode =3D 41243=3B it is always a primary key and not =0A= always on the same table. =0A= For now=2C you can fix the corrupted indexes by simple issuing REINDEX. Alt= hough I strongly recommend you doing a dump of all your databases=2C remove= it all and execute initdb again=2C and then restore the dumps. =0A= =0A= =0A= The system was previously upgraded from pg 8.3.7 and these issues did not =0A= occur. How have you managed the upgrade? Also=2C has been any hardware issue recen= tly? I also recommend you checking for disk and memory corruption. I need to give a little more background on this. The database is installed = standalone on many different hardware instances that are exactly the same. = The database is used for configuration in a closed software appliance much = like a consumer router. Acceptance testing of a fresh (no upgrade) pg 9.3.3= database instance has yielded a number of units with the primary key corru= ption issue after running for a short period of time (within a week of test= ing operation). As shown from the error message above the file that should = hold the primary key is truncated. The table corresponding to this also con= tains zero rows but is not corrupt and is expected to have zero rows. I am = suspecting a change in some behavior between pg 8.3.7 and 9.3.3 as the caus= e everything else being equal. At the moment I don't have much to go on as = I have not been able to reproduce the issue on demand however I am still wo= rking at trying to be a reproducible test case.=0A= =0A= Best regards=2C --=20 Matheus de Oliveira Analista de Banco de Dados Dextra Sistemas - MPS.Br n=EDvel F! www.dextra.com.br/postgres =0A= =0A= =0A= = --_b26fe4db-51b4-4e13-b8ce-d7a2ea5e87b0_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
On Mon=2C Apr 21=2C 2014 at 5:= 08 PM=2C <=3Blukecoldiron@hotmail.com>=3B wrote:
= =0A= =0A=

Is this server a slave? Or has i= t been at some point (and now promoted to master)?

=
It is not a slave server nor has it been at any point in time.
 =3B
=0A= =0A=
=0A= When I look on the filesystem the "base/16407/41243" file is zero bytes.=0A= When I lookup the object name that is currupt via select relname from
= =0A= pg_class where relfilenode =3D 41243=3B it is always a primary key and not<= br>=0A= always on the same table.
=0A=

For now=2C you can fix the corru= pted indexes by simple issuing REINDEX. Although I strongly recommend you d= oing a dump of all your databases=2C remove it all and execute initdb again= =2C and then restore the dumps.
=0A= =0A=
 =3B
=0A= The system was previously upgraded from pg 8.3.7 and these issues did not=0A= occur.

How = have you managed the upgrade? Also=2C has been any hardware issue recently?= I also recommend you checking for disk and memory corruption.

I need t= o give a little more background on this. The database is installed standalo= ne on many different hardware instances that are exactly the same. The data= base is used for configuration in a closed software appliance much like a c= onsumer router. Acceptance testing of a fresh (no upgrade) pg 9.3.3 databas= e instance has yielded a number of units with the primary key corruption is= sue after running for a short period of time (within a week of testing oper= ation). As shown from the error message above the file that should hold the= primary key is truncated. The table corresponding to this also contains ze= ro rows but is not =3Bcorrupt and is expected to have = zero rows. I am suspecting a change in some behavior between pg 8.3.7 and 9= .3.3 as the cause everything else being equal. At the moment I don't have m= uch to go on as I have not been able to reproduce the issue on demand howev= er I am still working at trying to be a =3Breproducible =3Btest case.
=0A= =0A=
Best regards=2C
--
Matheus de Oliveira
Analista de= Banco de Dados
Dextra Sistemas - MPS.Br n=EDvel F!
www.dextra.com.br/postgres<= /a>
=0A= =0A=
=0A=
= --_b26fe4db-51b4-4e13-b8ce-d7a2ea5e87b0_--