Bug 839924 - Modifying data in app-root/data dir cannot be restored by rhc-snapshot
Modifying data in app-root/data dir cannot be restored by rhc-snapshot
Status: CLOSED CURRENTRELEASE
Product: OpenShift Origin
Classification: Red Hat
Component: Containers (Show other bugs)
2.x
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: Rob Millner
libra bugs
: Triaged
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-07-13 04:41 EDT by shjiang
Modified: 2015-05-14 18:56 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-08-07 16:42:36 EDT
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)

  None (edit)
Description shjiang 2012-07-13 04:41:31 EDT
Description of problem:
Modifying data in app-root/data/ dir cannot be restored by rhc-snapshot
but modifying the data in app-root/repo dir can be restored.

the outputs of restoring the app print some information like:

Removing old data dir: ~/ruby1/app-root/data/*

in fact, the app-root dir is not under ruby1 dir and this leads to the file in app-root/data/ not deleted.

Version-Release number of selected component (if applicable):
stg.openshift.redhat.com
rhc-0.95.13

How reproducible:
always

Steps to Reproduce:
1.create an app;
2.save a tarball for app;
3.ssh to this app, touch a file under app-root/data/,exit;
4.modify some file in the local git repo,like config.ru,then git add/commit/push;
5.restore this app;
6.ssh to app, check the dir app-root/data,the file created in step 3 is still in the dir.but the modification in step 4 has been restored.
  
Actual results:
the file created in step 3 still exists.

Expected results:
the app-root/data/ dir is null.

Additional info:
Comment 1 Xiaoli Tian 2012-07-13 04:50:11 EDT
Guess bug 837484 may be this same issue with this.
Comment 2 Rob Millner 2012-07-13 15:47:56 EDT
Pull request:
https://github.com/openshift/crankcase/pull/231
Comment 3 Rob Millner 2012-07-13 17:35:40 EDT
Merged on master and stage.
Comment 4 shjiang 2012-07-16 04:45:14 EDT
It still fails in stage-2.0.14:
The data directory deleted in restoring is still ~/<app-name>/app-root/data/*.
The expected result is ~/app-root/data/* like in devenv-stage_225
Test result:
[root@jsq Documents]# rhc-snapshot -r php.tar.gz -a php -p redhat
Restoring from snapshot php.tar.gz...

Stopping application...
Waiting for stop to finish
Done
Removing old git repo: ~/git/php.git/
Removing old data dir: ~/php/app-root/data/*
Restoring ~/git/php.git and ~/app-root/data
~/git/php.git ~
~
Running .openshift/action_hooks/pre_build
Running .openshift/action_hooks/build
Running .openshift/action_hooks/deploy
Starting application...
Done
Running .openshift/action_hooks/post_deploy



But it's fixed in devenv-stage_225:
Test result:
[root@jsq .ssh]# rhc-snapshot -r php.tar.gz -a php -p redhat
Restoring from snapshot php.tar.gz...

Stopping application...
Waiting for stop to finish
Done
Removing old git repo: ~/git/php.git/
Removing old data dir: ~/app-root/data/*
Restoring ~/git/php.git and ~/app-root/data
~/git/php.git ~
~
Running .openshift/action_hooks/pre_build
Running .openshift/action_hooks/build
Running .openshift/action_hooks/deploy
Starting application...
Done
Running .openshift/action_hooks/post_deploy
Comment 5 shjiang 2012-08-03 00:03:52 EDT
Fixed on stage 2.0.15(devenv-stage_228)

[root@jsq .openshift]# rhc-snapshot -r ruby.tar.gz -a ruby -p redhat
Restoring from snapshot ruby.tar.gz...

Stopping application...
Waiting for stop to finish
Waiting for stop to finish
Waiting for stop to finish
Waiting for stop to finish
Done
Removing old git repo: ~/git/ruby.git/
Removing old data dir: ~/app-root/data/*
Restoring ~/git/ruby.git and ~/app-root/data
~/git/ruby.git ~
~
Running .openshift/action_hooks/pre_build
Running .openshift/action_hooks/build
Running .openshift/action_hooks/deploy
Starting application...
Done
Running .openshift/action_hooks/post_deploy

Note You need to log in before you can comment on or make changes to this bug.