Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1181916 - Openshift overwrites data/postgresql.conf during restart, destroying max_prepared_transactions setting
Openshift overwrites data/postgresql.conf during restart, destroying max_prep...
Status: CLOSED ERRATA
Product: OpenShift Container Platform
Classification: Red Hat
Component: Image (Show other bugs)
2.1.0
Unspecified Unspecified
high Severity medium
: ---
: ---
Assigned To: Jason DeTiberus
libra bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-01-13 23:53 EST by Hooman Broujerdi
Modified: 2016-08-09 00:05 EDT (History)
9 users (show)

See Also:
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.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-02-12 08:09:58 EST
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)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:0220 normal SHIPPED_LIVE Red Hat OpenShift Enterprise 2.2.4 bug fix and enhancement update 2015-02-12 13:08:20 EST

  None (edit)
Description Hooman Broujerdi 2015-01-13 23:53:43 EST
+++ 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 02:56:20 EST
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 08:09:58 EST
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.