Recv-Q buffer is filled up due to bgwriter continue sending statistics to un-launched stat collector

Поиск
Список
Период
Сортировка
От Hubert Zhang
Тема Recv-Q buffer is filled up due to bgwriter continue sending statistics to un-launched stat collector
Дата
Msg-id BN6PR05MB349246FF3AA8D752AAFC6CF9C9E00@BN6PR05MB3492.namprd05.prod.outlook.com
обсуждение исходный текст
Список pgsql-hackers
Hi hackers,

Bgwriter process will call `pgstat_send_bgwriter` to send statistics to stat collector, but stat collector is not started when standby is not in hot standby mode.

```
 if (pmState == PM_RUN || pmState == PM_HOT_STANDBY) 
      PgStatPID = pgstat_start();
```

This would lead to the kernel Recv-Q buffer being filled up by checking `netstat -du`.
I think we should disable to send statistics in `pgstat_send_bgwriter` when stat collector is not running. So here are three questions about how to fix it.
  1. Is there any way we could effectively check the status of stat collector in bgwriter process? 
  2. Is there any way we check the bgwriter is running on a standby but not in hot stanby mode?
  3. Is there any other process will send statistics except the bgwriter in standby? We should fix it one by one or add a check in `pgstat_send` directly?

Thanks,
Hubert Zhang

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

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: ResourceOwner refactoring
Следующее
От: "tsunakawa.takay@fujitsu.com"
Дата:
Сообщение: RE: POC: postgres_fdw insert batching