pgsql: Fix race condition in GIN posting tree page deletion.

Поиск
Список
Период
Сортировка
От Heikki Linnakangas
Тема pgsql: Fix race condition in GIN posting tree page deletion.
Дата
Msg-id E1Vesg9-0008LO-EG@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Fix race condition in GIN posting tree page deletion.

If a page is deleted, and reused for something else, just as a search is
following a rightlink to it from its left sibling, the search would continue
scanning whatever the new contents of the page are. That could lead to
incorrect query results, or even something more curious if the page is
reused for a different kind of a page.

To fix, modify the search algorithm to lock the next page before releasing
the previous one, and refrain from deleting pages from the leftmost branch
of the tree.

Add a new Concurrency section to the README, explaining why this works.
There is a lot more one could say about concurrency in GIN, but that's for
another patch.

Backpatch to all supported versions.

Branch
------
REL9_0_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/4b099e1bff528a149129732e4d5a1bf020f842ea

Modified Files
--------------
src/backend/access/gin/README      |   50 ++++++++++++++++++++++++++++++++++
src/backend/access/gin/ginbtree.c  |   53 ++++++++++++++++++++++++++++--------
src/backend/access/gin/ginget.c    |   25 ++++-------------
src/backend/access/gin/ginvacuum.c |   51 +++++++++++++++-------------------
src/include/access/gin.h           |    1 +
5 files changed, 121 insertions(+), 59 deletions(-)


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

Предыдущее
От: Heikki Linnakangas
Дата:
Сообщение: pgsql: Fix race condition in GIN posting tree page deletion.
Следующее
От: Heikki Linnakangas
Дата:
Сообщение: pgsql: Fix race condition in GIN posting tree page deletion.