Bug 849428

Summary: PostgreSQL cartridge: no statistics collector and no autovacuum
Product: OKD Reporter: Matthias Dieter Wallnöfer <mdw>
Component: ContainersAssignee: Ram Ranganathan <ramr>
Status: CLOSED DUPLICATE QA Contact: libra bugs <libra-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 2.xCC: M8R-7fin56, mephinet, mfisher, mpatel, sluskyb
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-08-20 18:51:57 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Matthias Dieter Wallnöfer 2012-08-19 12:14:22 UTC
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 18:51:57 UTC
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 16:49:27 UTC
funny, this bug is access-denied. I'm guessing the bug is not yet resolved?