Red Hat Bugzilla – Bug 849428
PostgreSQL cartridge: no statistics collector and no autovacuum
Last modified: 2015-08-07 14:29:51 EDT
Description of problem:
Statistics collector and autovacuum are not working with the PostgreSQL cartridge. The problem consists in the fact that the pg_stat module tries to create a UDP communication socket on IP address 127.0.0.1 (or whatever hostname "localhost" returns) which is blocked by the OpenShift platform (SELinux?).
The autovacuum module strictly depends on pg_stat in order to work.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Check out the logfiles under ~/postgresql-8.4/data/pg_log/
> LOG: could not bind socket for statistics collector: Permission denied
> LOG: disabling statistics collector for lack of working socket
> WARNING: autovacuum not started because of misconfiguration
> HINT: Enable the "track_counts" option.
> LOG: database system was shut down at 2012-08-19 06:05:22 EDT
> LOG: database system is ready to accept connections
> LOG: received fast shutdown request
> LOG: aborting any active transactions
> LOG: shutting down
> LOG: database system is shut down
The first four rows should disappear
In the upstream project it has been discussed to make this more dynamic without much luck: http://postgresql.1045698.n5.nabble.com/Add-statistics-collector-listen-addresses-to-fix-hard-coding-of-quot-localhost-quot-td4942610.html.
Here a GIT snapshot of pg_stat.c (pgstat_init() is the problematic call): http://git.postgresql.org/gitweb/?p=postgresql.git;a=blob;f=src/backend/postmaster/pgstat.c;h=1d80c311d879d9cf9009621860cda3ab19c6dea9;hb=04e96bc69d541dd7b5f4d3b3daf49d291c7fcbb4
Marking this as a duplicate of bugz 806016. Thanks for your analysis.
Yes, the issue is in pgstat.c which tries to bind/use localhost, which is not
allowed on OpenShift (we turned off bind capability to 127.0.0.1 -- would have to
use the internal ip somehow). Problematic call is this one:
pgstat.c:319: ret = pg_getaddrinfo_all("localhost", NULL, &hints, &addrs);
*** This bug has been marked as a duplicate of bug 806016 ***
funny, this bug is access-denied. I'm guessing the bug is not yet resolved?