Re: Sync Rep and shutdown Re: Sync Rep v19

Поиск
Список
Период
Сортировка
От Heikki Linnakangas
Тема Re: Sync Rep and shutdown Re: Sync Rep v19
Дата
Msg-id 4D81FD8B.5020301@enterprisedb.com
обсуждение исходный текст
Ответ на Re: Sync Rep and shutdown Re: Sync Rep v19  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: Sync Rep and shutdown Re: Sync Rep v19  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
On 16.03.2011 19:35, Robert Haas wrote:
> 3. If synchronous_standby_names is changed to '' by editing
> postgresql.conf and issuing pg_ctl reload, then cancel all waits in
> progress and wake everybody up.  As I mentioned before, reloading the
> config file from within the waiting backend (which can't safely throw
> an error) seems risky, so what I did instead is made WAL writer
> responsible for handling this.  Nobody's allowed to wait for sync rep
> unless a global shared memory flag is set, and the WAL writer process
> is responsible for setting and clearing this flag when the config file
> is reloaded.  This has basically no performance cost; WAL writer only
> ever does any extra work at all with this code when it receives a
> SIGHUP, and even then the work is trivial except in the case where
> synchronous_standby_names has changed from empty to non-empty or visca
> versa.  The advantage of putting this in WAL writer rather than, say,
> bgwriter is that WAL writer doesn't have nearly as many jobs to do and
> they don't involve nearly as much I/O, so the chances of a long delay
> due to the process being busy are much less.

Hmm, so setting synchronous_standby_names to '' takes effect 
immediately, but other changes to it don't apply to already-blocked 
commits. That seems a bit inconsistent. Perhaps walwriter should store 
the parsed list of standby-names in shared memory, not just a boolean.

+1 otherwise.

--   Heikki Linnakangas  EnterpriseDB   http://www.enterprisedb.com


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

Предыдущее
От: Jesper Krogh
Дата:
Сообщение: Re: really lazy vacuums?
Следующее
От: Cédric Villemain
Дата:
Сообщение: Re: really lazy vacuums?