Tuesday, April 05, 2005

corrupting postgresql

Carnage Blender ran out of space on its root partition Saturday. This is also the partition that has the postgresql data on it (WAL on a separate disk). Bad news: data from a few tables just disappeared in total violation of referential constraints. (Perhaps MVCC marked the old row as invalid for an UPDATE, but couldn't create the new row. Just guessing.)

This post seems to indicate that this was fixed for 8.0, although it may have gotten into one of the later 7.x releases (CB is still running the ancient-by-postgresql-standards 7.4.2 release, just over a year old) as well. Changelogs don't mention it specifically though.

I've rearranged disk usage so this won't happen again, but looking at the list of bugfixes through 7.4.7 I guess I should schedule some downtime to upgrade. Now that 8.0 has its first point release I should probably just bite the bullet and dump/reload to that. Unfortunately, Carnage Blender runs two multi-gig databases now, each with several circular dependencies that make necessary manual fiddling with the dumps before restoring.


xzilla said...

Doh! That's actually odd though cause I have run out of space before on postgresql and not lost any data.

One thing I wanted to mention was that you ought to wait for 8.0.2 to come out before you upgrade. It has some pretty big changes in it (for a patch release) so is probably worth waiting for (should be out within the next week) As always if you can, make sure you use the most recent pg_dump and try to test a reload of your db before making the switch. (Hey, another alternative might be to use slony to replicate the data onto the new version and then flip the switch)

Tim Lesher said...

That will teach you to rely on Postgres. You really need to upgrade to MySQL.

Jonathan Ellis said...

Smile when you say that... :)