Bug 1169306 - Httpd config dir of DB cartridge gear wouldn't be deleted
Summary: Httpd config dir of DB cartridge gear wouldn't be deleted
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OpenShift Online
Classification: Red Hat
Component: Containers
Version: 2.x
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: 2.x
Assignee: Ravi Sankar
QA Contact: libra bugs
URL:
Whiteboard:
Depends On: 1169303
Blocks: 1172323 1173026
TreeView+ depends on / blocked
 
Reported: 2014-12-01 09:59 UTC by Gaoyun Pei
Modified: 2015-05-14 23:38 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of: 1169303
Environment:
Last Closed: 2015-02-18 16:53:22 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Gaoyun Pei 2014-12-01 09:59:53 UTC
This issue should also exists in latest devenv: devenv_5328.

+++ This bug was initially created as a clone of Bug #1169303 +++

Description of problem:
When deleting an app on a node which is using vhost frontend, the httpd config files under /var/lib/openshift/.httpd.d will be deleted by frontend_plugin of watchman now.
But frontend_plugin would not delete the gear_dir when the gear doesn't have a *.conf file, such as db cartridge gear.


Version-Release number of selected component (if applicable):
2.2/2014-11-26.3
openshift-origin-node-util-1.31.3.1-1.el6op.noarch

How reproducible:
Always

Steps to Reproduce:
1.Create a scalable ruby app with mysql-5.1 embedded. These files and directories would generate under /var/lib/openshift/.httpd.d/.
The ruby+haproxy gear(547c2c19e5fed5f62e0000a6) has a httpd *.conf file and a corresponding directory. While the mysql(547c2c7ce5fed5f62e0000c6) gear only get an empty directory.

[root@node1 .httpd.d]# ls -al
...
-rw-r--r--. 1 root root     2539 Dec  1 01:51 547c2c19e5fed5f62e0000a6_domain1_0_testapp.conf
drwxr-xr-x. 2 root root     4096 Dec  1 01:51 547c2c19e5fed5f62e0000a6_domain1_testapp
drwxr-xr-x. 2 root root     4096 Dec  1 01:53 547c2c7ce5fed5f62e0000c6_domain1_547c2c7ce5fed5f62e0000c6
...


2.Delete the app. Use openshift-watchman to delete the left httpd config files.
  Set FRONTEND_CLEANUP_PERIOD=10 in /etc/sysconfig/watchman
  Change the Line 53 in /etc/openshift/watchman/plugins.d/frontend_plugin.rb as:
  "next if File.mtime(conf_file) > (DateTime.now - Rational(1, 86400))" to make the testing faster, or else need to wait for 1 hour.

3.Restart openshift-watchman service. Check the httpd files and directories agaiin. The empty dir of mysql gear still there.

[root@node1 .httpd.d]# ls -al
total 60
...
drwxr-xr-x. 2 root root     4096 Dec  1 01:53 547c2c7ce5fed5f62e0000c6_domain1_547c2c7ce5fed5f62e0000c6


Actual results:


Expected results:
All the files related to the deleted app should be removed.

Additional info:

Comment 2 openshift-github-bot 2014-12-02 17:23:00 UTC
Commit pushed to master at https://github.com/openshift/origin-server

https://github.com/openshift/origin-server/commit/ef1e1cf2f59e277dc090a345ddde66f4fa2d65ec
Bug 1169306: Clean up standalone db gear http conf in watchman.

Comment 3 Gaoyun Pei 2014-12-03 02:39:32 UTC
Verify this bug on devenv_5335

1. Create a scalable app with mysql-5.5 embed.
[root@ip-10-63-174-79 openshift]# rhc app show myapp1 --gears
ID                       State   Cartridges           Size  SSH URL
------------------------ ------- -------------------- ----- ------------------------------------------------------------------
547ebbec75e3e20064000002 started mysql-5.5            small 547ebbec75e3e20064000002.rhcloud.com
547ebbec75e3e2b6e1000005 started ruby-2.0 haproxy-1.4 small 547ebbec75e3e2b6e1000005.rhcloud.com

2. Delete the app. Then set the system date to 3 days later. Restart openshift-watchman service.

3. Check the files under /var/lib/openshift/.httpd.d/
There's no files or directories related to gear 547ebbec75e3e20064000002 or gear 547ebbec75e3e2b6e1000005.

Comment 4 Jhon Honce 2014-12-09 20:51:07 UTC
Reopened see https://bugzilla.redhat.com/show_bug.cgi?id=1172323

Comment 5 openshift-github-bot 2014-12-09 21:42:18 UTC
Commit pushed to master at https://github.com/openshift/origin-server

https://github.com/openshift/origin-server/commit/8432fe8a3e4d8eca7e2f66b018011cc4ed7d0599
Revert "Bug 1169306: Clean up standalone db gear http conf in watchman."

Comment 6 Brenton Leanhardt 2014-12-10 12:40:21 UTC
Can someone provide some more information on why this was reverted?

Comment 7 Brenton Leanhardt 2014-12-10 18:55:00 UTC
Nevermind.  I just found Bug #1172323.

Comment 9 Gaoyun Pei 2014-12-22 03:15:58 UTC
Verify this bug on devenv_5367

All the httpd config files and directories under /var/lib/openshift/.httpd.d will be deleted by frontend_plugin after app deleted


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