pgsql: When loading critical system indexes into the relcache, ensure we

From: tgl(at)postgresql(dot)org (Tom Lane)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: When loading critical system indexes into the relcache, ensure we
Date: 2010-01-13 23:07:09
Message-ID: 20100113230709.0783E7541B9@cvs.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Log Message:
-----------
When loading critical system indexes into the relcache, ensure we lock the
underlying catalog not only the index itself. Otherwise, if the cache
load process touches the catalog (which will happen for many though not
all of these indexes), we are locking index before parent table, which can
result in a deadlock against processes that are trying to lock them in the
normal order. Per today's failure on buildfarm member gothic_moth; it's
surprising the problem hadn't been identified before.

Back-patch to 8.2. Earlier releases didn't have the issue because they
didn't try to lock these indexes during load (instead assuming that they
couldn't change schema at all during multiuser operation).

Modified Files:
--------------
pgsql/src/backend/utils/cache:
relcache.c (r1.299 -> r1.300)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/cache/relcache.c?r1=1.299&r2=1.300)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2010-01-13 23:07:15 pgsql: When loading critical system indexes into the relcache, ensure we
Previous Message Tom Lane 2010-01-13 16:57:03 pgsql: Fix bug #5269: ResetPlanCache mustn't invalidate cached utility