Closed michalbiesek closed 1 year ago
Potential root cause:
SIGUSR2
seems to be used for communication between postmaster and backend https://www.postgresql.org/docs/7.0/signals.htm
With SCOPE_NO_SIGNAL=true
in Dockerfile we can use LD_PRELOAD and postgres can start normally
The work is done in #1538 .
QA instructions: Two integration test were added to cover the feature:
If the reviewer wants to test it manually I would recommend to see the integration tests in the previously mentioned Pull Request
Steps To Reproduce
Minimal Dockerfile which can be used to repro the issue
If we uncomment the
LD_PRELOAD
see that the container will not be able to start To start the test:LD_PRELOAD
log fromdocker run
LD_PRELOAD
log fromdocker run
The database cluster will be initialized with locale "en_US.utf8". The default database encoding has accordingly been set to "UTF8". The default text search configuration will be set to "english".
Data page checksums are disabled.
fixing permissions on existing directory /var/lib/postgresql/data ... ok creating subdirectories ... ok selecting dynamic shared memory implementation ... posix selecting default max_connections ... 100 selecting default shared_buffers ... 128MB selecting default time zone ... Etc/UTC creating configuration files ... ok running bootstrap script ... ok performing post-bootstrap initialization ... ok syncing data to disk ... ok
initdb: warning: enabling "trust" authentication for local connections You can change this by editing pg_hba.conf or using the option -A, or --auth-local and --auth-host, the next time you run initdb.
Success. You can now start the database server using:
waiting for server to start....2023-06-21 11:42:00.675 UTC [35] LOG: starting PostgreSQL 14.8 (Debian 14.8-1.pgdg120+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit 2023-06-21 11:42:00.676 UTC [35] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432" 2023-06-21 11:42:00.680 UTC [38] LOG: database system was shut down at 2023-06-21 11:42:00 UTC 2023-06-21 11:42:00.685 UTC [35] LOG: database system is ready to accept connections done server started CREATE DATABASE
/usr/local/bin/docker-entrypoint.sh: ignoring /docker-entrypoint-initdb.d/*
waiting for server to shut down....2023-06-21 11:42:00.998 UTC [35] LOG: received fast shutdown request 2023-06-21 11:42:00.999 UTC [35] LOG: aborting any active transactions 2023-06-21 11:42:01.001 UTC [35] LOG: background worker "logical replication launcher" (PID 47) exited with exit code 1 ........................................................... failed pg_ctl: server does not shut down