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

Re: Going for "all green" buildfarm results

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: Stefan Kaltenbrunner <stefan(at)kaltenbrunner(dot)cc>, Andrew Dunstan <andrew(at)dunslane(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Going for "all green" buildfarm results
Date: 2006-07-30 15:44:44
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
Alvaro Herrera <alvherre(at)commandprompt(dot)com> writes:
> Stefan Kaltenbrunner wrote:
>> FYI: lionfish just managed to hit that problem again:

> The test alter_table, which is on the same parallel group as limit (the
> failing test), contains these lines:
> ALTER INDEX onek_unique1 RENAME TO tmp_onek_unique1;
> ALTER INDEX tmp_onek_unique1 RENAME TO onek_unique1;

I bet Alvaro's spotted the problem.  ALTER INDEX RENAME doesn't seem to
take any lock on the index's parent table, only on the index itself.
That means that a query on "onek" could be trying to read the pg_class
entries for onek's indexes concurrently with someone trying to commit
a pg_class update to rename an index.  If the query manages to visit
the new and old versions of the row in that order, and the commit
happens between, *neither* of the versions would look valid.  MVCC
doesn't save us because this is all SnapshotNow.

Not sure what to do about this.  Trying to lock the parent table could
easily be a cure-worse-than-the-disease, because it would create
deadlock risks (we've already locked the index before we could look up
and lock the parent).  Thoughts?

The path of least resistance might just be to not run these tests in
parallel.  The chance of this issue causing problems in the real world
seems small.

			regards, tom lane

In response to


pgsql-hackers by date

Next:From: David FetterDate: 2006-07-30 16:04:04
Subject: Re: New variable server_version_num
Previous:From: Tom LaneDate: 2006-07-30 15:27:33
Subject: Re: New variable server_version_num

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