Description of problem: I noticed that over time, our quota files have accumulated a large number of entries for deleted users. At first I thought this only happened when a gear delete failed partway through, but it looks like there's not even an attempt to unset the quota on delete. Version-Release number of selected component (if applicable): rubygem-openshift-origin-node-1.24.9-1.el6oso.noarch How reproducible: Always Steps to Reproduce: 1. create an app: rhc app create test php 2. log into the node, and note the numeric uid of the user rhc ssh test id -u 3. delete the app rhc app delete test 4. Log into the node as root, and run: repquota -v /var/lib/openshift | grep <UUID> where <UUID> is the result of the "id -u" command above. 5. See a line like: #1567 -- 0 0 1048576 0 0 80000 Actual results: A quota entry exists Expected results: Quota entries should be cleaned up when accounts are deleted. Additional info: This should simply be a matter of running this: "setquota -u <UUID> 0 0 0 0 /var/lib/openshift" immediately before the user is deleted. After the fact, you can run the command with the UID instead of UUID.
The disable_fs_limits() call in selinux_container#destroy() should resolve to the setquota command given in description.
right, should, but doesn't because you've already deleted the user entry, so you have to set quota for the numeric uid rather than the UUID. So probably the fix is just changing this in disable_fs_limits: ::OpenShift::Runtime::Node.remove_pam_limits(@container.uuid) to ::OpenShift::Runtime::Node.remove_pam_limits(@container.uid)
Comment #2 was obviously a copy-paste fail ... I meant: ::OpenShift::Runtime::Node.remove_quota(@container.uuid) to ::OpenShift::Runtime::Node.remove_quota(@container.uid)
I can reproduce the bug on devenv-stage_861 with new mount point /. # repquota -v / ... #1000 -- 0 0 1048576 0 0 80000
The fix actually takes a little more work due to our use of "always-resolve". Here's the patch that worked for me: https://github.com/a13m/origin-server/commit/b7a83174d85d2534b8c4223d04b1b198469e5b6e I have not gone through the tests yet, though.
Fixed with pull request : https://github.com/openshift/origin-server/pull/5503
Checked on devenv_4862, the quota for the deleted gear will be deleted together. Will also do regression testing for the changes. Move the bug to verified.