]> granicus.if.org Git - postgresql/commit
When loading critical system indexes into the relcache, ensure we lock the
authorTom Lane <tgl@sss.pgh.pa.us>
Wed, 13 Jan 2010 23:07:22 +0000 (23:07 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Wed, 13 Jan 2010 23:07:22 +0000 (23:07 +0000)
commit8a6a40dea66ee86b3e5d41f4ad572964c5510005
tree8ddc648529adda7a0da66829433abd6ca6d0f0e3
parentd4b7cf062cb136f20cdd15166f94ce1e68505025
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).
src/backend/utils/cache/relcache.c