pgsql: Fix relcache reload mechanism to be more robust in the face of

Поиск
Список
Период
Сортировка
От tgl@postgresql.org (Tom Lane)
Тема pgsql: Fix relcache reload mechanism to be more robust in the face of
Дата
Msg-id 20100112181241.260ED7541B9@cvs.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Log Message:
-----------
Fix relcache reload mechanism to be more robust in the face of errors
occurring during a reload, such as query-cancel.  Instead of zeroing out
an existing relcache entry and rebuilding it in place, build a new relcache
entry, then swap its contents with the old one, then free the new entry.
This avoids problems with code believing that a previously obtained pointer
to a cache entry must still reference a valid entry, as seen in recent
failures on buildfarm member jaguar.  (jaguar is using CLOBBER_CACHE_ALWAYS
which raises the probability of failure substantially, but the problem
could occur in the field without that.)  The previous design was okay
when it was made, but subtransactions and the ResourceOwner mechanism
make it unsafe now.

Also, make more use of the already existing rd_isvalid flag, so that we
remember that the entry requires rebuilding even if the first attempt fails.

Back-patch as far as 8.2.  Prior versions have enough issues around relcache
reload anyway (due to inadequate locking) that fixing this one doesn't seem
worthwhile.

Tags:
----
REL8_2_STABLE

Modified Files:
--------------
    pgsql/src/backend/utils/cache:
        relcache.c (r1.250.2.3 -> r1.250.2.4)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/cache/relcache.c?r1=1.250.2.3&r2=1.250.2.4)

В списке pgsql-committers по дате отправления:

Предыдущее
От: tgl@postgresql.org (Tom Lane)
Дата:
Сообщение: pgsql: Fix relcache reload mechanism to be more robust in the face of
Следующее
От: mha@postgresql.org (Magnus Hagander)
Дата:
Сообщение: pgsql: Update MSVC build instructions.