Skip site navigation (1) Skip section navigation (2)

I broke pg_upgrade for GiST

From: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgreSQL(dot)org>
Subject: I broke pg_upgrade for GiST
Date: 2013-01-16 12:18:21
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
I just realized that my patch that turned XLogRecPtr into a uint64 
changed the on-disk format of GiST indexes, because the NSN field in the 
page header is an XLogRecPtr. Oops. Fortunately that's easy to fix. I 
avoided the same issue with LSNs by continuing to use the old two-field 
struct in the on-disk format, we just need to do the same for the NSN 
field in GiST. Patch attached.

This got me thinking: although the problem is immediately visible when 
you try to run queries on an upgraded gist index - you get incorrect 
results - the test procedure explained in TESTING file and performed by 
tests.h won't catch this.

We're never going to have full coverage of all possible 
incompatibilities, but it would be nice to have at least a simple test 
suite that creates an index using each indexam, and checks that they 
still work after upgrade.

- Heikki

Attachment: make-gist-on-disk-compatible-again-1.patch
Description: text/x-diff (7.7 KB)

pgsql-hackers by date

Next:From: Robert HaasDate: 2013-01-16 12:53:12
Subject: Re: Parallel query execution
Previous:From: Magnus HaganderDate: 2013-01-16 12:18:04
Subject: Re: CF3+4 (was Re: Parallel query execution)

Privacy Policy | About PostgreSQL
Copyright © 1996-2018 The PostgreSQL Global Development Group