[BUG] autovacuum may skip tables when session_authorization/role is set on database

Поиск
Список
Период
Сортировка
От Imseih (AWS), Sami
Тема [BUG] autovacuum may skip tables when session_authorization/role is set on database
Дата
Msg-id 4814073F-6387-4873-8B8E-4D6A7390DEC7@amazon.com
обсуждение исходный текст
Ответы Re: [BUG] autovacuum may skip tables when session_authorization/role is set on database  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: [BUG] autovacuum may skip tables when session_authorization/role is set on database  (vignesh C <vignesh21@gmail.com>)
Список pgsql-hackers

Hi,

 

A recent case in the field in which a database session_authorization is

altered to a non-superuser, non-owner of tables via alter database .. set session_authorization ..

caused autovacuum to skip tables.

 

The issue was discovered on 13.10, and the logs show such messages:

 

warning:  skipping "table1" --- only table or database owner can vacuum it

 

In HEAD, I can repro, but the message is now a bit different due to [1].

 

WARNING:  permission denied to vacuum "table1”, skipping it

 

It seems to me we should force an autovacuum worker to set the session userid to

a superuser.

 

Attached is a repro and a patch which sets the session user to the BOOTSTRAP superuser

at the start of the autovac worker.

 

Thoughts?

 

Regards,

 

Sami

Amazon Web Services (AWS)

 

 

[1] https://postgr.es/m/20220726.104712.912995710251150228.horikyota.ntt@gmail.com

 

Вложения

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

Предыдущее
От: Andrew Dunstan
Дата:
Сообщение: Re: Clean up find_typedefs and add support for Mac
Следующее
От: Andrew Dunstan
Дата:
Сообщение: Re: Add --check option to pgindent