BUG #1731: Indexes are corrupt following an unclean shutdown

From: "Adam Kruger" <ackruger(at)hotmail(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #1731: Indexes are corrupt following an unclean shutdown
Date: 2005-06-24 19:58:48
Message-ID: 20050624195848.2A449F0B12@svr2.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


The following bug has been logged online:

Bug reference: 1731
Logged by: Adam Kruger
Email address: ackruger(at)hotmail(dot)com
PostgreSQL version: 8.0.03
Operating system: Linux
Description: Indexes are corrupt following an unclean shutdown
Details:

I have encountered a condition similar to those referenced at:

http://archives.postgresql.org/pgsql-admin/2005-06/msg00051.php

and

http://archives.postgresql.org/pgsql-bugs/2005-06/msg00142.php

I have come up with a simple method for reproducing this error condition.

This method is reproducable on a linux (2.6) system with ext3 file systems
and hard disk write caching disabled.

1. Run the following script:

#########################
#!/bin/sh

/bin/su - postgres -c '/usr/bin/createdb test' && \
echo "create table t1 ( name varchar(20) primary key, address varchar(20)
);" \
| (/bin/su - postgres -c '/usr/bin/psql test ') && \
echo "create table t2 ( name varchar(20) primary key, address varchar(20)
);" \
| (/bin/su - postgres -c '/usr/bin/psql test ') && \
echo "create table t3 ( name varchar(20) primary key, address varchar(20)
);" \
| (/bin/su - postgres -c '/usr/bin/psql test ') && \
echo "create table t4 ( name varchar(20) primary key, address varchar(20)
);" \
| (/bin/su - postgres -c '/usr/bin/psql test ') && \
echo "create table t5 ( name varchar(20) primary key, address varchar(20)
);" \
| (/bin/su - postgres -c '/usr/bin/psql test ') && \
echo "create table t6 ( name varchar(20) primary key, address varchar(20)
);" \
| (/bin/su - postgres -c '/usr/bin/psql test ') && \
echo "create table t7 ( name varchar(20) primary key, address varchar(20)
);" \
| (/bin/su - postgres -c '/usr/bin/psql test ') && \
echo "create table t8 ( name varchar(20) primary key, address varchar(20)
);" \
| (/bin/su - postgres -c '/usr/bin/psql test ') && \
echo "create table t9 ( name varchar(20) primary key, address varchar(20)
);" \
| (/bin/su - postgres -c '/usr/bin/psql test ')

#########################

2. When the script completes, press the reset button.

3. When the system comes back up, log on and try the following:

vacuumdb -Upostgres test

An error is returned indicating that an index is not a valid btree.

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Michael Fuhr 2005-06-24 22:52:09 Re: BUG #1730: insert into x1.tbl select x2.tbl dont work
Previous Message Krasimir dimitrov 2005-06-24 15:08:58 BUG #1730: insert into x1.tbl select x2.tbl dont work