Bug 1181916 - Openshift overwrites data/postgresql.conf during restart, destroying max_prepared_transactions setting
Summary: Openshift overwrites data/postgresql.conf during restart, destroying max_prep...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: ImageStreams
Version: 2.1.0
Hardware: Unspecified
OS: Unspecified
high
medium
Target Milestone: ---
: ---
Assignee: Jason DeTiberus
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-01-14 04:53 UTC by Hooman Broujerdi
Modified: 2019-03-22 07:32 UTC (History)
9 users (show)

Fixed In Version: openshift-origin-cartridge-postgresql-1.32.0.1-1
Doc Type: Bug Fix
Doc Text:
Cause: Configuration templates did not account for max_prepared_transactions. Consequence: max_prepared_transactions was not set to the value from OPENSHIFT_POSTGRESQL_MAX_PREPARED_TRANSACTIONS Fix: Configuration templates have been updated to ensure postgres configuration matches the environment variable. Result: If the environment variable OPENSHIFT_POSTGRESQL_MAX_PREPARED_TRANSACTIONS is set the postgres configuration honor that value at restart. If the variable is not set the value will be zero.
Clone Of:
Environment:
Last Closed: 2015-02-12 13:09:58 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:0220 0 normal SHIPPED_LIVE Red Hat OpenShift Enterprise 2.2.4 bug fix and enhancement update 2015-02-12 18:08:20 UTC

Description Hooman Broujerdi 2015-01-14 04:53:43 UTC
+++ This bug was initially created as clone of Bug #1123850 +++

Description of problem:

By default, PostgreSQL database server parameters may be disabled or set to a different value. For example: max_prepared_transactions is set to 0, which disables XA transactions.

According to Bug #1123850 in order to set such parameters this should be feasible by setting an appropriate environment varibale, however this doesn't seem to work.

How reproducible: 

1. Create an application with a postgresql database. 
2. Set an appropriate environment variable : 

[hooman@dhcp-0-201 bug1123850]$ rhc env-set OPENSHIFT_POSTGRESQL_MAX_PREPARED_TRANSACTIONS="100" -a bug1123850
Setting environment variable(s) ... done

3. Restart the application or the database service.
[hooman@dhcp-0-201 bug1123850]$ rhc cartridge restart postgresql-9.2 -a bug1123850
Restarting postgresql-9.2 ... done

Actual results:

Revisiting the postgresql.conf doesn't have the parameter set and the parameter is wiped - this doesn't work either if the parameter is set manually by modifying the data/postgresql.conf and restarting the service. 

NOTE: The above works if the parameters are already exists in the postgresql.conf e.g: 

rhc env-set OPENSHIFT_POSTGRESQL_SHARED_BUFFERS=256 -a bug1123850
Setting environment variable(s) ... done

[hooman@dhcp-0-201 bug1123850]$ rhc cartridge restart postgresql-9.2 -a bug1123850
Restarting postgresql-9.2 ... done

Expected results:

The environment variable for the appropriate parameters have to be set in the data/postgresql.conf.

Comment 7 Gaoyun Pei 2015-01-26 07:56:20 UTC
Verify this bug with openshift-origin-cartridge-postgresql-1.32.0.1-1 on 2.2/2015-01-23.2. Both postgresql-8.4 and postgresql-9.2 work well with the new env var OPENSHIFT_POSTGRESQL_MAX_PREPARED_TRANSACTIONS.


1. Create an app with postgresql-8.4 embedded, check its default max_prepared_transactions settings in 
postgresql/data/postgresql.conf.

[app-123.ose22-manual.com.cn data]\> grep max_prepared_transactions *
postgresql.conf:max_prepared_transactions = 0


2. Set env vars to modify datestyle and locale vars
[root@broker ~]# rhc env-set OPENSHIFT_POSTGRESQL_MAX_PREPARED_TRANSACTIONS=100 -a app
Setting environment variable(s) ... done


3. Restart the postgres cartridge
[root@broker ~]# rhc cartridge restart postgresql -a app
Using postgresql-8.4 (PostgreSQL 8.4) for 'postgresql'
Restarting postgresql-8.4 ... done


4. Check postgresql/data/postgresql.conf again. The env vars setting by user was taking effect

[app-123.ose22-manual.com.cn data]\> grep max_prepared_transactions postgresql.conf 
max_prepared_transactions = 100

Comment 11 errata-xmlrpc 2015-02-12 13:09:58 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://rhn.redhat.com/errata/RHBA-2015-0220.html


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