Bug 849428 - PostgreSQL cartridge: no statistics collector and no autovacuum
PostgreSQL cartridge: no statistics collector and no autovacuum
Status: CLOSED DUPLICATE of bug 806016
Product: OpenShift Origin
Classification: Red Hat
Component: Containers (Show other bugs)
2.x
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: Ram Ranganathan
libra bugs
: Triaged
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-08-19 08:14 EDT by Matthias Dieter Wallnöfer
Modified: 2015-08-07 14:29 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-08-20 14:51:57 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Matthias Dieter Wallnöfer 2012-08-19 08:14:22 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):
/

How reproducible:
always

Steps to Reproduce:
1. Check out the logfiles under ~/postgresql-8.4/data/pg_log/
  
Actual results:
> 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

Expected results:
The first four rows should disappear

Additional info:
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
Comment 1 Ram Ranganathan 2012-08-20 14:51:57 EDT
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 ***
Comment 2 Anonymous account 2013-08-08 12:49:27 EDT
funny, this bug is access-denied. I'm guessing the bug is not yet resolved?

Note You need to log in before you can comment on or make changes to this bug.