RE: Some shared memory chunks are allocated even if related processes won't start

Поиск
Список
Период
Сортировка
От Hayato Kuroda (Fujitsu)
Тема RE: Some shared memory chunks are allocated even if related processes won't start
Дата
Msg-id TYCPR01MB12077D982922BFD6FE8706758F5232@TYCPR01MB12077.jpnprd01.prod.outlook.com
обсуждение исходный текст
Ответ на Re: Some shared memory chunks are allocated even if related processes won't start  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
Ответы Re: Some shared memory chunks are allocated even if related processes won't start  ('Alvaro Herrera' <alvherre@alvh.no-ip.org>)
Список pgsql-hackers
Dear Alvaro,

Thanks for giving comments!

> > While reading codes, I found that ApplyLauncherShmemInit() and
> > AutoVacuumShmemInit() are always called even if they would not be
> > launched.
> 
> Note that there are situations where the autovacuum launcher is started
> even though autovacuum is nominally turned off, and I suspect your
> proposal would break that.  IIRC this occurs when the Xid or multixact
> counters cross the max_freeze_age threshold.

Right. In GetNewTransactionId(), SetTransactionIdLimit() and some other places,
PMSIGNAL_START_AUTOVAC_LAUNCHER is sent to postmaster when the xid exceeds
autovacuum_freeze_max_age. This work has already been written in the doc [1]:

```
To ensure that this does not happen, autovacuum is invoked on any table that
might contain unfrozen rows with XIDs older than the age specified by the
configuration parameter autovacuum_freeze_max_age. (This will happen even
if autovacuum is disabled.)
```

This means that my first idea won't work well. Even if the postmaster does not
initially allocate shared memory, backends may request to start auto vacuum and
use the region. However, the second idea is still valid, which allows the allocation
of shared memory dynamically. This is a bit efficient for the system which tuples
won't be frozen. Thought?

[1]: https://www.postgresql.org/docs/devel/routine-vacuuming.html#VACUUM-FOR-WRAPAROUND

Best Regards,
Hayato Kuroda
FUJITSU LIMITED
https://www.fujitsu.com/ 


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

Предыдущее
От: Dean Rasheed
Дата:
Сообщение: Re: MERGE ... WHEN NOT MATCHED BY SOURCE
Следующее
От: Jelte Fennema-Nio
Дата:
Сообщение: Re: Injection points: some tools to wait and wake