Why SyncOneBuffer does not called frequently?

Поиск
Список
Период
Сортировка
От 高健
Тема Why SyncOneBuffer does not called frequently?
Дата
Msg-id CAL454F2Om3VY_5gvn4_VWfQ+4niKhqu7CpW6OJEFi+z_JwY8qg@mail.gmail.com
обсуждение исходный текст
Ответы Re: Why SyncOneBuffer does not called frequently?  (Jeff Janes <jeff.janes@gmail.com>)
Список pgsql-general
Hi all:

I am trying to understand when the bgwriter is written.

I thought that the  bgwriter.c's calling turn is:

BackgroundWriterMain ->BgBufferSync-> SyncOneBuffer

And In my postgresql.conf , the bgwriter_delay=200ms.

I did the following:

postgres=# select * from testtab;
 id |  val  
----+-------
  1 | 12345
(1 row)

postgres=# update testtab set val='54321' where id=1;
UPDATE 1
postgres=# select * from testtab;
 id |  val  
----+-------
  1 | 54321
(1 row)

postgres=# 

Now I can say the buffer is dirty ,right?

I wait for a few minutes, I can found bgwriter's BackgroundWriterMain called BgBufferSync many times.

But I can't find BgBufferSync really call SyncOneBuffer to put the dirty data todisk.

Untill I close the postgres process, I can find the SyncOneBuffer is called for many times.

My question is: 
Why even there are dirty buffer(s), the SyncOneBuffer is still not called?  
Is it violating the background writer's purpose? 

Or the flushing to disk will be done untill  the amount of block/buffer is satisfied? If so , what is it?

Thanks in advance for any help

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: How to setup chained CA?
Следующее
От: Mahmoud Hakeem-Habeeb
Дата:
Сообщение: Delay streaming replication using a paramter