Re: Increase of buffers usage count by bgwriter

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Increase of buffers usage count by bgwriter
Дата
Msg-id 6879.1130342777@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Increase of buffers usage count by bgwriter  (ITAGAKI Takahiro <itagaki.takahiro@lab.ntt.co.jp>)
Ответы Re: Increase of buffers usage count by bgwriter  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
ITAGAKI Takahiro <itagaki.takahiro@lab.ntt.co.jp> writes:
> I found that bgwriter increments usage count of buffers when it writes
> the buffers. I feel this behavior is strange, because the behavior of
> bgwriter will affect buffer management strategy.

Good point --- we probably don't want it to do that.

> If the behavior is not intended, another UnpinBuffer that doesn't
> increase the buffers usage count will be needed.
> Otherwise, bgwriter should do behavior that looks like VACUUM, 
> using StrategyHintVacuum(true).

I think it might be sufficient to not increment usage_count when
UnpinBuffer's "trashOK" parameter is false --- that's what
SyncOneBuffer passes, so it'd fix the issue for bgwriter activity,
and arguably all the other call sites that pass false also don't
want the count to increment.

(Probably need a different name for trashOK ...)

Comments?
        regards, tom lane


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: add_missing_from breaks existing views
Следующее
От: Grzegorz Piotr Jaskiewicz
Дата:
Сообщение: Re: problem with custom Gist for custom type