Re: A note about hash-based catcache invalidations

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: A note about hash-based catcache invalidations
Дата
Msg-id 26518.1313601055@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: A note about hash-based catcache invalidations  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: A note about hash-based catcache invalidations  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
BTW, while we're thinking about this ...

The plpython patch Jan just submitted reminds me that several of the PLs
detect whether they have obsolete cached data by noting whether the
tuple's xmin *and* TID are the same as previously seen.

Unlike depending on TID alone, I think this is probably safe.  It can
obviously give a false positive (thinks tuple changed when it didn't)
after a catalog VACUUM FULL; but an error in that direction is safe.
What would be problematic is a false negative (failure to notice a
real change), and I think the inclusion of the xmin in the test protects
us against that.  An example scenario is:

1. We cache the data, saving xmin X1 and TID T1.

2. VACUUM FULL moves the tuple to TID T2.

3. Somebody else updates the tuple, by chance moving it right back to
T1.  But they will assign a new xmin X2, so we will know it changed.

Can anyone think of a situation this does not cover?
        regards, tom lane


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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: PATCH: Compiling PostgreSQL using ActiveState Python 3.2
Следующее
От: Tom Lane
Дата:
Сообщение: Re: PATCH: Compiling PostgreSQL using ActiveState Python 3.2