pgsql: Fix up flushing of composite-type typcache entries to be driven

Поиск
Список
Период
Сортировка
От tgl@postgresql.org (Tom Lane)
Тема pgsql: Fix up flushing of composite-type typcache entries to be driven
Дата
Msg-id 20100902031713.13F6C7541E2@cvs.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Log Message:
-----------
Fix up flushing of composite-type typcache entries to be driven directly by
SI invalidation events, rather than indirectly through the relcache.

In the previous coding, we had to flush a composite-type typcache entry
whenever we discarded the corresponding relcache entry.  This caused problems
at least when testing with RELCACHE_FORCE_RELEASE, as shown in recent report
from Jeff Davis, and might result in real-world problems given the kind of
unexpected relcache flush that that test mechanism is intended to model.

The new coding decouples relcache and typcache management, which is a good
thing anyway from a structural perspective.  The cost is that we have to
search the typcache linearly to find entries that need to be flushed.  There
are a couple of ways we could avoid that, but at the moment it's not clear
it's worth any extra trouble, because the typcache contains very few entries
in typical operation.

Back-patch to 8.2, the same as some other recent fixes in this general area.
The patch could be carried back to 8.0 with some additional work, but given
that it's only hypothetical whether we're fixing any problem observable in
the field, it doesn't seem worth the work now.

Tags:
----
REL8_2_STABLE

Modified Files:
--------------
    pgsql/src/backend/utils/cache:
        relcache.c (r1.250.2.6 -> r1.250.2.7)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/cache/relcache.c?r1=1.250.2.6&r2=1.250.2.7)
        typcache.c (r1.22 -> r1.22.2.1)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/cache/typcache.c?r1=1.22&r2=1.22.2.1)
    pgsql/src/include/utils:
        typcache.h (r1.12 -> r1.12.2.1)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/utils/typcache.h?r1=1.12&r2=1.12.2.1)

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

Предыдущее
От: tgl@postgresql.org (Tom Lane)
Дата:
Сообщение: pgsql: Fix up flushing of composite-type typcache entries to be driven
Следующее
От: tgl@postgresql.org (Tom Lane)
Дата:
Сообщение: pgsql: Clean up some bad grammar and punctuation in description of