[Pkg-postgresql-public] Bug#784005: postgresql-9.4: Cluster upgrade from 9.1 to 9.4 results in broken configuration

Gunnar Wolf gwolf at gwolf.org
Sat May 2 02:23:12 UTC 2015


Source: postgresql-9.4
Version: 9.4.1-1
Severity: important

I upgraded a server (a LXC-based container) from Wheezy to
Jessie. After installing, everything looked OK, with the (live) 9.1
and (empty) 9.4 clusters running.

Now, following the instructions at
/usr/share/doc/postgresql-common/README.Debian.gz (section "Default
clusters and upgrading") led to a seemingly correct cluster migration
— Just at the final step, at the cluster restart time, I got:

2015-05-02 01:27:01 GMT FATAL:  could not open shared memory segment "/PostgreSQL.1804289383": Function not implemented

Increasing the log verbosity to DEBUG5 yielded:

2015-05-02 01:57:55 GMT DEBUG:  postgres: PostmasterMain: initial environment dump:
2015-05-02 01:57:55 GMT DEBUG:  -----------------------------------------
2015-05-02 01:57:55 GMT DEBUG:          PG_GRANDPARENT_PID=2343
2015-05-02 01:57:55 GMT DEBUG:          PGLOCALEDIR=/usr/share/locale
2015-05-02 01:57:55 GMT DEBUG:          PGSYSCONFDIR=/etc/postgresql-common
2015-05-02 01:57:55 GMT DEBUG:          LANG=en_US.UTF-8
2015-05-02 01:57:55 GMT DEBUG:          PWD=/var/lib/postgresql
2015-05-02 01:57:55 GMT DEBUG:          PGDATA=/var/lib/postgresql/9.4/main
2015-05-02 01:57:55 GMT DEBUG:          LC_COLLATE=en_US.UTF-8
2015-05-02 01:57:55 GMT DEBUG:          LC_CTYPE=en_US.UTF-8
2015-05-02 01:57:55 GMT DEBUG:          LC_MESSAGES=en_US.UTF-8
2015-05-02 01:57:55 GMT DEBUG:          LC_MONETARY=C
2015-05-02 01:57:55 GMT DEBUG:          LC_NUMERIC=C
2015-05-02 01:57:55 GMT DEBUG:          LC_TIME=C
2015-05-02 01:57:55 GMT DEBUG:  -----------------------------------------
2015-05-02 01:57:56 GMT DEBUG:  invoking IpcMemoryCreate(size=23822336)
2015-05-02 01:57:56 GMT DEBUG:  mmap with MAP_HUGETLB failed, huge pages disabled: Cannot allocate memory
2015-05-02 01:57:56 GMT DEBUG:  SlruScanDirectory invoking callback on pg_notify/0000
2015-05-02 01:57:56 GMT DEBUG:  removing file "pg_notify/0000"
2015-05-02 01:57:56 GMT DEBUG:  dynamic shared memory system will support 288 segments
2015-05-02 01:57:56 GMT FATAL:  could not open shared memory segment "/PostgreSQL.1804289383": Function not implemented
2015-05-02 01:57:56 GMT DEBUG:  shmem_exit(1): 0 before_shmem_exit callbacks to make
2015-05-02 01:57:56 GMT DEBUG:  shmem_exit(1): 3 on_shmem_exit callbacks to make
2015-05-02 01:57:56 GMT DEBUG:  proc_exit(1): 2 callbacks to make
2015-05-02 01:57:56 GMT DEBUG:  exit(1)
2015-05-02 01:57:56 GMT DEBUG:  shmem_exit(-1): 0 before_shmem_exit callbacks to make
2015-05-02 01:57:56 GMT DEBUG:  shmem_exit(-1): 0 on_shmem_exit callbacks to make
2015-05-02 01:57:56 GMT DEBUG:  proc_exit(-1): 0 callbacks to make

Now, looking through the Web, this page gave me the needed insight:

    http://postgresql.nabble.com/Shared-memory-changes-in-9-4-td5804919.html

The problem apparently happened because pg_upgradecluster uses my 9.1
config for 9.4, which does not include a part of the
configuration. And following on the quoted webpage, I had to specify:

    dynamic_shared_memory_type = sysv

As posix semantics seem not to work under LXC (or not under its
default configuration).

Thanks!

-- System Information:
Debian Release: 8.0
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 3.19.0-eudyptula5d12e3524822-00194-gd799964 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)



More information about the Pkg-postgresql-public mailing list