Bug 772152

Summary: mysql DB IP is changed after move this app from one node to another node.
Product: OKD Reporter: Johnny Liu <jialiu>
Component: PodAssignee: Krishna Raman <kraman>
Status: CLOSED NOTABUG QA Contact: libra bugs <libra-bugs>
Severity: high Docs Contact:
Priority: high    
Version: 1.xCC: dmcphers, mfisher
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-01-06 14:48:41 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Johnny Liu 2012-01-06 07:33:51 UTC
Description of problem:
mysql DB IP is changed after move this app from one node to another node.
mysql DB IP is often used in user's app, if this IP is changed after rhc-admin-move, that means user's app with mysql embedded will can not be connected.

Version-Release number of selected component (if applicable):
rhc-broker-0.84.28-1.el6_2.noarch

How reproducible:
Always

Steps to Reproduce:
1. Setup a mutli node env
2. Create an app with mysql embeded.
3. In this app, use mysql DB IP got from embed mysql operation output as hard code for db connection.
e.g: here is an example of php app
----<snip>----
  if ($action_name == "create"){
    $con=mysql_connect("127.0.250.1","admin","gb1epCRi3ewm") or die(mysql_error());
    mysql_select_db("myapp",$con);
    mysql_query("DROP TABLE IF EXISTS ucctalk",$con);
    mysql_query("CREATE TABLE ucctalk (speaker CHAR(30), title CHAR(60))",$con);
    mysql_query("INSERT INTO ucctalk (speaker,title) VALUES ('speaker1', 'title1')",$con);
    $result=mysql_query("SELECT * FROM ucctalk",$con);
    while($row=mysql_fetch_array($result)) {
      echo $row['speaker'],", ",$row['title'],"\n";
    }
    mysql_close($con);
----<snip>----
3. Log into libra server, run "rhc-admin-move" command to move this app from
one node to another node.
4. Access this app again to access DB, found DB connection failed.
5. Run rhc-user-info command, found mysql DB IP address is changed.

  
Actual results:
After run "rhc-admin-move" command to move this app from
one node to another node, user's app failed to access.

Expected results:
move operation on server side should be transparent, no any affect for user's app.

Additional info:

Comment 1 Johnny Liu 2012-01-06 07:48:03 UTC
Of course, if app is using OPENSHIFT_DB_XX env variable, this issue not critical. But if user is using DB IP as hard code, it will be risky, because user is unable to notice DB IP's change. So it is better to keep the same DB IP address. I guess before move app on server side, to check if this DB IP is occupied in destination node is necessary.

Comment 2 Dan McPherson 2012-01-06 14:48:41 UTC
This is as designed and necessary.  Once we move to using districts this will no longer happen regularly but will have to happen at least once to get to districts.