+++ 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.
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
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