EvalPlanQual() doesn't follow LockTuple() pattern

Поиск
Список
Период
Сортировка
От Simon Riggs
Тема EvalPlanQual() doesn't follow LockTuple() pattern
Дата
Msg-id CANP8+jKoMAyXvMO2hUqFzHX8fYSFc82q9MEse2zAEOC8vxwDfA@mail.gmail.com
обсуждение исходный текст
Ответы Re: EvalPlanQual() doesn't follow LockTuple() pattern
Список pgsql-hackers
src/backend/access/heap/README.tuplock says we do this...

LockTuple()
XactLockTableWait()
mark tuple as locked by me
UnlockTuple()

only problem is we don't... because EvalPlanQualFetch() does this

XactLockTableWait()
LockTuple()

If README.tuplock's reasons for the stated lock order is correct then
it implies that EvalPlanQual updates could be starved indefinitely,
which is probably bad.

It might also be a bug of more serious nature, though no bug seen.
This was found while debugging why wait_event not set correctly.

In any case, I can't really see any reason for this coding in
EvalPlanQual and it isn't explained in comments. Simply removing the
wait allows the access pattern to follow the documented lock order,
and allows regression tests and isolation tests to pass without
problem. Perhaps I have made an error there.

Thoughts?

--
Simon Riggs                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Вложения

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

Предыдущее
От: Simon Riggs
Дата:
Сообщение: XactLockTableWait doesn't set wait_event correctly
Следующее
От: Amos Bird
Дата:
Сообщение: Re: make default TABLESPACE belong to target table.