Re: Bug#43221: postgresql: When disk is full, insert corrupts indices

Started by Oliver Elphickover 26 years ago2 messages
#1Oliver Elphick
olly@lfix.co.uk

camm@enhanced.com wrote:

Package: postgresql
Version: 6.5.1-6

I'm forwarding this to the hackers list, because it presumably is an issue
to be addressed in the code for rolling back an aborted transaction. I
suppose that there is nothing there to handle the case that the index file
runs out of diskspace and that therefore the index became corrupt.

Mind you, I'm just guessing!

I tried inserting a record into the table 'rolo' described below. Rolo
had two indices, also described below. When the disk was full, the
insert failed with a NOTICE: transaction abort and not in progress
error. Stopping and starting the postmaster, clearing the disk, and
repeating then gave, alternately, a 'cannot insert duplicate' error (the
insert was not a duplicate) and a 'rolo_pkey is not a btree' error (which
it was, to start with). Dropping both indices and rebuilding them restored
functionality.

Here are the relevant table/index definitions:

There was nothing at all out of the ordinary about them: I think they are not
likely to be relevant to the problem.

-- System Information
Debian Release: 2.1
Kernel Version: Linux intech19 2.2.7 #1 SMP Thu May 27 11:53:43 EDT 1999 i68
6 unknown

Versions of the packages postgresql depends on:
ii libc6 2.0.7.19981211 GNU C Library: shared libraries
ii libc6 2.0.7.19981211 GNU C Library: shared libraries
ii libncurses4 4.2-3 Shared libraries for terminal handling
ii libpgsql2 6.5.1-6 Shared library libpq.so.2 for PostgreSQL
ii debianutils 1.10 Miscellaneous utilities specific to Debia
n.

--
Vote against SPAM: http://www.politik-digital.de/spam/
========================================
Oliver Elphick Oliver.Elphick@lfix.co.uk
Isle of Wight http://www.lfix.co.uk/oliver
PGP key from public servers; key ID 32B8FAA1
========================================
"But I would not have you to be ignorant, brethren,
concerning them which are asleep, that ye sorrow not,
even as others which have no hope. For if we believe
that Jesus died and rose again, even so them also
which sleep in Jesus will God bring with him."
I Thessalonians 4:13,14

#2Vadim Mikheev
vadim@krs.ru
In reply to: Oliver Elphick (#1)
Re: [HACKERS] Re: Bug#43221: postgresql: When disk is full, insert corrupts indices

Oliver Elphick wrote:

camm@enhanced.com wrote:

Package: postgresql
Version: 6.5.1-6

I'm forwarding this to the hackers list, because it presumably is an issue
to be addressed in the code for rolling back an aborted transaction. I
suppose that there is nothing there to handle the case that the index file
runs out of diskspace and that therefore the index became corrupt.

Whenever index insert fails (for _any_ reason) index may be
corrupted. I hope to address this with WAL...

Vadim