Improve behavior of concurrent TRUNCATE

Поиск
Список
Период
Сортировка
Искать
От
Michael Paquier
Тема
Improve behavior of concurrent TRUNCATE
Дата
Msg-id
20180806165816.GA19883@paquier.xyz
Список
Дерево обсуждения
Improve behavior of concurrent TRUNCATE Michael Paquier <michael@paquier.xyz>
Re: Improve behavior of concurrent TRUNCATE Alvaro Herrera <alvherre@2ndquadrant.com>
Re: Improve behavior of concurrent TRUNCATE Michael Paquier <michael@paquier.xyz>
Re: Improve behavior of concurrent TRUNCATE Alvaro Herrera <alvherre@2ndquadrant.com>
Re: Improve behavior of concurrent TRUNCATE Robert Haas <robertmhaas@gmail.com>
Re: Improve behavior of concurrent TRUNCATE Michael Paquier <michael@paquier.xyz>
Re: Improve behavior of concurrent TRUNCATE Alvaro Herrera <alvherre@2ndquadrant.com>
Re: Improve behavior of concurrent TRUNCATE "Bossart, Nathan" <bossartn@amazon.com>
Re: Improve behavior of concurrent TRUNCATE Michael Paquier <michael@paquier.xyz>
Re: Improve behavior of concurrent TRUNCATE "Bossart, Nathan" <bossartn@amazon.com>
Re: Improve behavior of concurrent TRUNCATE Michael Paquier <michael@paquier.xyz>
Re: Improve behavior of concurrent TRUNCATE "Bossart, Nathan" <bossartn@amazon.com>
Re: Improve behavior of concurrent TRUNCATE Michael Paquier <michael@paquier.xyz>
Hi all,

This is a second thread I am spawning for the previous thread "Canceling
authentication due to timeout aka Denial of Service Attack":
https://www.postgresql.org/message-id/152512087100.19803.12733865831237526317%40wrigleys.postgresql.org

And this time the discussion is about TRUNCATE, as the former thread
discussed about a family of failures hence it is harder to catch the
proper attention.  The problem is that when we look for the relation OID
of the relation to truncate, we don't use a callback with
RangeVarGetRelidExtended, causing a lock acquire attempt to happen
before checking the privileges on the relation for the user running the
command.

Attached is a patch I have been working on which refactors the code of
TRUNCATE in such a way that we check for privileges before trying to
acquire a lock, without any user-facing impact (I have reworked a couple
of comments compared to the last version).  This includes a set of tests
showing the new behavior.

Like cbe24a6, perhaps we would not want to back-patch it?  Based on the
past history (and the consensus being reached for the REINDEX case would
be to patch only HEAD), I would be actually incline to not back-patch
this stuff and qualify that as an improvement.  That's also less work
for me at commit :)

Thoughts?
--
Michael
В списке pgsql-hackers по дате отправления
От: Stephen Frost
Дата:
От: Jaime Casanova
Дата:
FAQ