Bug 837484

Summary: Scalable app's snapshot tarball doesn't contain all gears' files under OPENSHIFT_DATA_DIR
Product: OKD Reporter: jizhao
Component: ContainersAssignee: Rob Millner <rmillner>
Status: CLOSED DEFERRED QA Contact: libra bugs <libra-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 2.xCC: mfisher, szhou
Target Milestone: ---Keywords: FutureFeature, Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-07-09 22:44:08 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:
Embargoed:

Description jizhao 2012-07-04 05:14:29 UTC
Description of problem:
Create a scalable app, write some code to create files under OPENSHIFT_DATA_DIR. Save snapshot of the app and check the tarball. The file isn't in the tarball.
After creating a scalable app, two dirs are created, one of which contains haproxy. While saving snapshot, only the dir which contains haproxy are snapshoted, but the file we created though our app is in the OPENSHIFT_DATA_DIR of the other dir.

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

How reproducible:
Always

Steps to Reproduce:
1.Create a scalable app(take jbossas-7 for example)
$ rhc app create -a app1 -t jbossas-7 -s -d
2.Write some code to create file under OPENSHIFT_DATA_DIR. Git push all the changes.
==> data.jsp <==
<%@ page contentType="text/html" language="java" import="java.sql.*" %>
<%@ page import="javax.naming.*" %>
<%@ page import="java.io.*"  %>
<%@ page import="java.util.*"  %>

<%
Map map = System.getenv();
String cmd = "dd if=/dev/urandom of=" + map.get("OPENSHIFT_DATA_DIR") + "bigfile bs=1M count=3";
out.println("Command: " + cmd);
Process p = Runtime.getRuntime().exec(cmd);
BufferedReader input = new BufferedReader(new InputStreamReader(p.getInputStream()));
String line = null;
while((line = input.readLine()) != null) {
    out.println(line);
}
out.println("<br />");
p.waitFor();
if(p.exitValue() == 0) {
    out.println("The big file has been created under OPENSHIFT_DATA_DIR");
}
else {
    out.println("Failed to create bigfile under OPENSHIFT_DATA_DIR");
}
%>


3.Visit <app_url>/data.jsp to create file under OPENSHIFT_DATA_DIR.

4.Save snapshot of the app. Extract it and check <gear_uuid>/app-root/data/.

5.Use Openshift shell to login the app and check app-root/data/.
  
Actual results:
4. There's no file under <gear_uuid>/app-root/data/.
5. There's no file under app-root/data/.

Expected results:
There file we created should be contained in the snapshot tarball.

Additional info:

Comment 1 Rob Millner 2012-07-05 18:27:45 UTC
This may be due to the backup not gathering files from secondary gears in the application.

Comment 2 Rob Millner 2012-07-09 22:44:08 UTC
User story US2526 opened to track backups/restore of scalable applications.  Deferring this request based on the user story.