Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1334249

Summary: postgresql-slave pod is CrashLoopBackOff if using postgresql_replica.json to create psql
Product: OpenShift Container Platform Reporter: wewang <wewang>
Component: ImageStreamsAssignee: Michal Fojtik <mfojtik>
Status: CLOSED ERRATA QA Contact: Wang Haoran <haowang>
Severity: medium Docs Contact:
Priority: medium    
Version: 3.2.0CC: adellape, aos-bugs, hhorak, jokerman, mmccomas, yantan
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
When attempting to run a PostgreSQL slave pod from the upstream replica template, the pod could get stuck in CrashLoopBackOff status, citing a "MEMORY_LIMIT_IN_BYTES: unbound variable" error. This bug fix ensures that cgroup limits are properly handled for such pods, and as a result this issue no longer occurs.
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-06-27 15:06:55 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 wewang 2016-05-09 09:19:22 UTC
Version-Release number of selected component (if applicable):
  openshift v3.2.0.20
  kubernetes v1.2.0-36-g4a3f9c5
   etcd 2.2.5
 rhscl/postgresql-94-rhel7        latest              edcff6672345        2    days ago          285.9 MB

How reproducible:
always

Steps to Reproduce:
1. Create project 
2. Create pv 
3. Using template to creat psql
  $wget https://raw.githubusercontent.com/openshift/postgresql/master/examples/replica/postgresql_replica.json #replace openshift/postgresql-92-centos7 with brew-pulp-docker01.web.prod.ext.phx2.redhat.com:8888/rhscl/postgresql-94-rhel7  in above json
4. oc new-app postgresql_replica.json
5. Check the pod 
   [root@dhcp-128-91 backup]# oc get pods
NAME                        READY     STATUS             RESTARTS   AGE
postgresql-master-1-fkvy9   1/1       Running            0          11s
postgresql-slave-1-9kmaz    0/1       CrashLoopBackOff   1          9s
postgresql-slave-1-deploy   1/1       Running            0          20s

6. [root@dhcp-128-91 backup]# oc logs postgresql-slave-1-9kmaz
/usr/share/container-scripts/postgresql/common.sh: line 8: MEMORY_LIMIT_IN_BYTES: unbound variable

Actual results:
slave pod is not running

Expected results:
slave pod should be run

Comment 1 wewang 2016-05-09 09:51:48 UTC
Additional info:
 related to target 3.3 user story:https://trello.com/c/Z4SfZLob/883-2-update-postgresql-image-to-autoconfigure-based-on-available-memory-evg

Comment 2 Honza Horak 2016-05-09 12:58:28 UTC
I believe this should fix it:
https://github.com/openshift/postgresql/pull/112
(not tested yet though)

Comment 3 Honza Horak 2016-05-09 20:28:07 UTC
fixed rhscl/postgresql-94-rhel7:9.4-6.4 is in internal registry, feel free to re-test.

Comment 6 errata-xmlrpc 2016-06-27 15:06:55 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2016:1343