Bug 839924 - Modifying data in app-root/data dir cannot be restored by rhc-snapshot
Summary: Modifying data in app-root/data dir cannot be restored by rhc-snapshot
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OKD
Classification: Red Hat
Component: Containers
Version: 2.x
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Rob Millner
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-07-13 08:41 UTC by shjiang
Modified: 2015-05-14 22:56 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-08-07 20:42:36 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description shjiang 2012-07-13 08:41:31 UTC
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 08:50:11 UTC
Guess bug 837484 may be this same issue with this.

Comment 2 Rob Millner 2012-07-13 19:47:56 UTC
Pull request:
https://github.com/openshift/crankcase/pull/231

Comment 3 Rob Millner 2012-07-13 21:35:40 UTC
Merged on master and stage.

Comment 4 shjiang 2012-07-16 08:45:14 UTC
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 04:03:52 UTC
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.