Bug 1045661

Summary: Some configurations on mysql/conf/my.cnf file, but after restarting the gear, the configuration is lost.
Product: OpenShift Online Reporter: Roberto <atl_totto>
Component: ImageAssignee: Jakub Hadvig <jhadvig>
Status: CLOSED CURRENTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 2.xCC: chunchen, xtian
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-01-30 00:54:07 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:

Description Roberto 2013-12-21 00:25:02 UTC
Description of problem:

In a Mysql Cartridge I can configure the timezone on mysql/conf/my.cnf file, but after restarting the gear, the configuration is lost.

Version-Release number of selected component (if applicable):

Mysql cartridge

How reproducible:

Steps to Reproduce:
1. Configure timezone on mysql/conf/my.cnf file from Mysql Cartridge
2. Restart the gear using gear restart
3. The configuration is lost

Actual results:

The timezone value, is not available as env varialbe, so on cartridge restart the manual configuration is lost.

Expected results:

Timezone value can be configured by an env variable, something like "rhc env set OPENSHIFT_MYSQL_TIMEZONE=-06:00"

Additional info:

Comment 1 Jakub Hadvig 2014-01-08 17:02:06 UTC
Hi Roberto,
thank you for the report.
I had add the OPENSHIFT_MYSQL_TIMEZONE, so now when you use:

rhc set-env -a a OPENSHIFT_MYSQL_TIMEZONE='+06:00'

it will set the default server timezone and after you restart the gear, the value is preserved. 

I had create a PR for this
https://github.com/openshift/origin-server/pull/4431
Once the PR is merged, the new release of openshift-online will have this functionality.

-Jakub

Comment 2 chunchen 2014-01-10 05:56:42 UTC
It's fixed on devenv_4204, check it with mysql embedded into non-scaled and scaled application, please refer to the following results:

1. For non-scaled app with mysql
1) Create a non-scaled app with mysql
rhc app create redmine9 ruby-1.9 mysql-5.1
2) Add the OPENSHIFT_MYSQL_TIMEZONE variable
rhc set-env -a a OPENSHIFT_MYSQL_TIMEZONE='+06:00' -a redmine9
3) Restart the app
rhc app restart redmine9
4) Check the variable
$ rhc list-env -a redmine9
OPENSHIFT_MYSQL_TIMEZONE=+06:00

1. For scaled app with mysql
1) Create a non-scaled app with mysql
rhc app create cphps php-5.4 mysql-5.5 -s --no-git
2) Add the OPENSHIFT_MYSQL_TIMEZONE variable
rhc set-env -a a OPENSHIFT_MYSQL_TIMEZONE='+06:00' -a cphps
3) Restart mysql cart and this app
rhc cartridge restart mysql-5.5 -a cphps
rhc app restart cphps
4) Check the variable
$ rhc ssh cphps --gear 'env | grep TIMEZONE | grep -v grep'
[52cf881a678cc086c400002b php-5.4+haproxy-1.4] OPENSHIFT_MYSQL_TIMEZONE=+06:00
[52cf881a678cc0092f000002 mysql-5.5] OPENSHIFT_MYSQL_TIMEZONE=+06:00