Incorrect relation locked at beginning of REINDEX CONCURRENTLY

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Incorrect relation locked at beginning of REINDEX CONCURRENTLY
Дата
Msg-id 20191021074323.GB1869@paquier.xyz
обсуждение исходный текст
Список pgsql-hackers
Hi all,

While digging into the issues reported lately about REINDEX
CONCURRENTLY, I have bumped into the following, independent, issue:
/* Now open the relation of the new index, a lock is also needed on it */
newIndexRel = index_open(indexId, ShareUpdateExclusiveLock)

In this code path, indexId is the OID od the old index copied, and
newIndexId is the OID of the new index created.  So that's clearly
incorrect, and the comment even says the intention.  This causes for
example the same session lock to be taken twice on the old index, with
the new index remaining unprotected.

Any objections if I fix this issue as per the attached?
--
Michael

Вложения

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

Предыдущее
От: Thunder
Дата:
Сообщение: [BUG] standby node can not provide service even it replays all logfiles
Следующее
От: Thunder
Дата:
Сообщение: Re:[BUG] standby node can not provide service even it replays alllog files