Bug 849428 - PostgreSQL cartridge: no statistics collector and no autovacuum
Summary: PostgreSQL cartridge: no statistics collector and no autovacuum
Keywords:
Status: CLOSED DUPLICATE of bug 806016
Alias: None
Product: OKD
Classification: Red Hat
Component: Containers
Version: 2.x
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Ram Ranganathan
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-08-19 12:14 UTC by Matthias Dieter Wallnöfer
Modified: 2015-08-07 18:29 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-08-20 18:51:57 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

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?


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