Re: [Patch] ALTER SYSTEM READ ONLY

Поиск
Список
Период
Сортировка
От Amul Sul
Тема Re: [Patch] ALTER SYSTEM READ ONLY
Дата
Msg-id CAAJ_b94dR7NKwnUmBi3bv99N_rqWHTtasSVGky7W89BEJk5q8w@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [Patch] ALTER SYSTEM READ ONLY  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
Hi,

The attached version is updated w.r.t. some of the review comments
from Soumyadeep and Andres.

Two thing from Andres' review comment are not addressed are:

1. Only superuser allowed to execute AlterSystemSetWALProhibitState(). As per
Andres instead we should do this in a GRANTable manner. I tried that but
got a little confused with the roles that we could use for ASRO and didn't see
any much appropriate one. pg_signal_backend could have been suited for ASRO
where we terminate some of the backends but a user granted this role is not
supposed to terminate the superuser backend. If we used that we need to check a
superuser backend and raise an error or warning. Other roles are
pg_write_server_files or pg_execute_server_program but I am not sure we should
use either of this, seems a bit confusing to me. Any suggestion or am I missing
something here?

2. About walprohibit.c/.h file, Andres' concern on file name is that WAL
related file names are started with xlog. I think renaming to xlog* will not be
the correct and will be more confusing since function/variable/macros inside
walprohibit.c/.h files contain the walprohibit keyword.  And another concern is due to
separate file we have to include it to many places but I think that will be
one time pain and worth it to keep code modularised.

Andres, Robert, do let me know your opinion on this if you think we should merge
walprohibit.c/.h file into xlog.c/.h, will do that in the next version.


Changes in the attached version are:

1. Renamed readonly_cv to walprohibit_cv.
2. Removed repetitive comments for CheckWALPermitted() &
AssertWALPermitted_HaveXID().
3. Renamed AssertWALPermitted_HaveXID() to AssertWALPermittedHaveXID().
4. Changes to avoid repeated RelationNeedsWAL() calls.
5. IsWALProhibited() made static inline function.
6. Added outfuncs and readfuncs functions.
7. Added error when read-only state transition is in progress and other backends
trying to make the system read-write or vice versa. Previously 2nd backend seeing
command that was executed successfully but it wasn't.
8. Merged checkpointer code changes patch to 0002.

Regards,
Amul
Вложения

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

Предыдущее
От: Masahiko Sawada
Дата:
Сообщение: Re: [PATCH] Tab completion for VACUUM of partitioned tables
Следующее
От: Amul Sul
Дата:
Сообщение: Re: [Patch] ALTER SYSTEM READ ONLY