powered by simpleCommunicator - 2.0.52     © 2025 Programmizd 02
Форумы / PostgreSQL [игнор отключен] [закрыт для гостей] / FATAL: no free slots in PMChildFlags array
7 сообщений из 7, страница 1 из 1
FATAL: no free slots in PMChildFlags array
    #40023328
Guzya
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
Доброго времени, всем!

Столкнулись с падением postgres.

В логе следующее
Код: sql
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
........
2020-11-27 23:00:49 UTC 172.25.41.176(52562) [17014]: [1-1] FATAL:  sorry, too many clients already
2020-11-27 23:00:49 UTC 172.25.41.176(52563) [17015]: [1-1] FATAL:  sorry, too many clients already
2020-11-27 23:00:49 UTC  [32353]: [34-1] FATAL:  no free slots in PMChildFlags array
2020-11-27 23:00:50 UTC  [32353]: [35-1] LOG:  database system is shut down
2020-11-27 23:00:50 UTC 172.25.41.102(48032) [17684]: [73723-1] FATAL:  terminating connection due to unexpected postmaster exit
2020-11-27 23:00:50 UTC 172.25.41.188(48764) [19856]: [1-1] FATAL:  terminating connection due to unexpected postmaster exit
2020-11-27 23:00:50 UTC 172.25.41.102(41496) [11271]: [1-1] FATAL:  terminating connection due to unexpected postmaster exit
2020-11-27 23:00:50 UTC 172.25.41.102(41579) [11396]: [1-1] FATAL:  postmaster exited during a parallel transaction
2020-11-27 23:00:50 UTC 172.25.41.102(41579) [11396]: [2-1] STATEMENT:  select t.itemid,t.type,t.snmp_community,t.snmp_oid,t.hostid,t.key_,t.delay,t.status,t.value_type,t.trapper_hosts,t.snmpv3_securityname,t.snmpv3_securitylevel,t.snmpv3_authpassphrase,t.snmpv3_privpassphrase,t.lastlogsize,t.logtimefmt,t.params,t.ipmi_sensor,t.authtype,t.username,t.password,t.publickey,t.privatekey,t.mtime,t.flags,t.interfaceid,t.port,t.snmpv3_authprotocol,t.snmpv3_privprotocol,t.snmpv3_contextname,t.jmx_endpoint,t.master_itemid,t.timeout,t.url,t.query_fields,t.posts,t.status_codes,t.follow_redirects,t.post_type,t.http_proxy,t.headers,t.retrieve_mode,t.request_method,t.output_format,t.ssl_cert_file,t.ssl_key_file,t.ssl_key_password,t.verify_peer,t.verify_host,t.allow_traps from items t,hosts r where t.hostid=r.hostid and r.proxy_hostid=400400000019683 and r.status in (0,1) and t.flags<>2 and t.type in (0,7,1,4,6,12,2,3,9,10,11,13,14,16,17,5,19,18) order by t.itemid
2020-11-27 23:00:50 UTC 172.25.41.21(35816) [33773]: [1-1] FATAL:  terminating connection due to unexpected postmaster exit
2020-11-27 23:00:50 UTC 172.25.41.102(48032) [17684]: [73724-1] WARNING:  could not remove shared memory segment "/PostgreSQL.880443765": No such file or directory
2020-11-27 23:00:50 UTC 172.25.41.102(41496) [11271]: [2-1] WARNING:  could not remove shared memory segment "/PostgreSQL.853469056": No such file or directory
2020-11-27 23:00:50 UTC 172.25.41.102(41579) [11396]: [3-1] WARNING:  could not remove shared memory segment "/PostgreSQL.1846032836": No such file or directory
2020-11-27 23:00:50 UTC 172.25.41.102(41746) [11734]: [1-1] FATAL:  terminating connection due to unexpected postmaster exit
2020-11-27 23:00:50 UTC 172.25.41.188(48510) [21505]: [1-1] FATAL:  terminating connection due to unexpected postmaster exit
.......



Почитал архив рассылки, там идет обсуждение, что проблема связанна с ребутом виртуальной машины в состоянии суспенд.
Но в нашем случаи с ВМ ни каких действий не происходило.

max_connections=800 и до него мы не добрались.

Какие есть идеи по причине падения?
...
Рейтинг: 0 / 0
FATAL: no free slots in PMChildFlags array
    #40023343
Guzya
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
Postgres 11
...
Рейтинг: 0 / 0
FATAL: no free slots in PMChildFlags array
    #40023371
Melkij
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
Guzya
max_connections=800 и до него мы не добрались.

Неужели?
Guzya
2020-11-27 23:00:49 UTC 172.25.41.176(52562) [17014]: [1-1] FATAL: sorry, too many clients already


Код: c
1.
	/* Out of slots ... should never happen, else postmaster.c messed up */
	elog(FATAL, "no free slots in PMChildFlags array");

https://github.com/postgres/postgres/blob/REL_11_STABLE/src/backend/storage/ipc/pmsignal.c#L172
Делали, тем не менее, что-то очень странное с postmaster'ом.
...
Рейтинг: 0 / 0
FATAL: no free slots in PMChildFlags array
    #40023375
Guzya
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
Я видел этот кусок кода.
Но даже если достигнуто максимальное значение, то почему postgres решил выключиться, а не продолжил отвергать подключения
пока кто-нибудь не отключиться.

Если я правильно понимаю, то размер массива берется отсюда:
Код: sql
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
/*
 * MaxLivePostmasterChildren
 *
 * This reports the number of entries needed in per-child-process arrays
 * (the PMChildFlags array, and if EXEC_BACKEND the ShmemBackendArray).
 * These arrays include regular backends, autovac workers, walsenders
 * and background workers, but not special children nor dead_end children.
 * This allows the arrays to have a fixed maximum size, to wit the same
 * too-many-children limit enforced by canAcceptConnections().  The exact value
 * isn't too critical as long as it's more than MaxBackends.
 */
int
MaxLivePostmasterChildren(void)
{
	return 2 * (MaxConnections + autovacuum_max_workers + 1 +
				max_wal_senders + max_worker_processes);
}
...
Рейтинг: 0 / 0
FATAL: no free slots in PMChildFlags array
    #40023377
Guzya
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
Подсчитал в логе сообщения
Код: sql
1.
FATAL:  terminating connection due to unexpected


получилось 278
...
Рейтинг: 0 / 0
FATAL: no free slots in PMChildFlags array
    #40023380
Melkij
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
Guzya,

потому что should never happen. Если сюда попали - значит что-то очень не так и лучше выключиться чем пытаться работать в непредусмотренных условиях.
...
Рейтинг: 0 / 0
FATAL: no free slots in PMChildFlags array
    #40023383
Guzya
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
А есть идеи, что пошло не так, куда смотреть и т.д.
...
Рейтинг: 0 / 0
7 сообщений из 7, страница 1 из 1
Форумы / PostgreSQL [игнор отключен] [закрыт для гостей] / FATAL: no free slots in PMChildFlags array
Целевая тема:
Создать новую тему:
Автор:
Закрыть
Цитировать
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]