BUG #17938: could not open shared memory segment "/PostgreSQL.615216676": No such file or directory

From: PG Bug reporting form <noreply(at)postgresql(dot)org>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: onkobu(at)onkobutanaake(dot)de
Subject: BUG #17938: could not open shared memory segment "/PostgreSQL.615216676": No such file or directory
Date: 2023-05-22 18:10:43
Message-ID: 17938-ecf9088be46db806@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 17938
Logged by: Onkobu Tanaake
Email address: onkobu(at)onkobutanaake(dot)de
PostgreSQL version: 15.3
Operating system: Gentoo
Description:

After upgrade from 14 to 15 from time to time this error occurs. A snapshot
of a responsive database looks like this:

$> ls -la /dev/shm/PostgreSQL.*
-rw------- 1 postgres postgres 1048576 May 22 19:18
/dev/shm/PostgreSQL.2644390168
-rw------- 1 postgres postgres 26176 May 22 19:14
/dev/shm/PostgreSQL.3338605124

$> lsof | grep PostgreSQL
postgres 16944 postgres mem REG 0,49
26176
2 /dev/shm/PostgreSQL.3338605124
postgres 16945 postgres mem REG 0,49
26176
2 /dev/shm/PostgreSQL.3338605124
postgres 16946 postgres mem REG 0,49
26176
2 /dev/shm/PostgreSQL.3338605124
postgres 16948 postgres mem REG 0,49
26176
2 /dev/shm/PostgreSQL.3338605124
postgres 16949 postgres mem REG 0,49
1048576
3 /dev/shm/PostgreSQL.2644390168
postgres 16949 postgres mem REG 0,49
26176
2 /dev/shm/PostgreSQL.3338605124
postgres 16950 postgres mem REG 0,49
1048576
3 /dev/shm/PostgreSQL.2644390168
postgres 16950 postgres mem REG 0,49
26176
2 /dev/shm/PostgreSQL.3338605124
postgres 16958 postgres mem REG 0,49
1048576
3 /dev/shm/PostgreSQL.2644390168
postgres 16958 postgres mem REG 0,49
26176
2 /dev/shm/PostgreSQL.3338605124

$> df -h
Filesystem Size Used Avail Use% Mounted on
[…]
shm 32G 1.1M 32G 1% /dev/shm
[…]

Config (postgresql.conf) is as follows:

max_wal_size = 2GB
min_wal_size = 1GB
effective_cache_size = 8GB
log_timezone = 'Europe/Berlin'
datestyle = 'iso, mdy'
timezone = 'Europe/Berlin'
default_text_search_config = 'pg_catalog.english'
plperl.on_init = 'use utf8; use re; package utf8; require
"utf8_heavy.pl";'

I don't use shared_memory_type and also not dynamic_shared_memory_type so
they're default (mmap for the first, posix for the second). Got the settings
from https://pgtune.leopard.in.ua/ for a conservative use on a 32GByte 8
core/ 16 threads machine.

Building goes along the lines of an ebuild
https://gitweb.gentoo.org/repo/gentoo.git/tree/dev-db/postgresql/postgresql-15.3.ebuild#n117.
I enabled icu, kerberos, nls, pam, ssl, threads, uuid, xml and zlib.

The server does not run any systemd but is pure Init-V. So it is very
unlikely that a systemd process causes this.Also no container in use. Init
process directly runs postgres server. Kernel is 5.15.80 and was the same
for version 14. I also don't log in with the postgres-user which is also
impossible (disabled in /etc/shadow). WIthin 7 days this happens very
likely/ at least once. How can I track this down further?

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Michael Paquier 2023-05-22 22:43:11 Re: BUG #17938: could not open shared memory segment "/PostgreSQL.615216676": No such file or directory
Previous Message Tristan Partin 2023-05-22 17:04:58 Re: BUG #17698: On SIGTERM, psql terminates, but leaves the statement running