Bug 981619 - oo-admin-chk should not check subaccount
Summary: oo-admin-chk should not check subaccount
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: OpenShift Online
Classification: Red Hat
Component: Pod
Version: 2.x
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Ravi Sankar
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-07-05 09:50 UTC by Jianwei Hou
Modified: 2015-05-15 00:18 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-07-05 19:12:07 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Jianwei Hou 2013-07-05 09:50:01 UTC
Description of problem:
oo-admin-chk fails due to a mismatch between gear and mongo, which was created by a subaccount. 

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

How reproducible:
Always

Steps to Reproduce:
1. Grant account with subaccount capacity
oo-admin-ctl-user --allowsubaccount true --inheritgearsize true --addgearsize c9 -l jhou
2. Create subaccount, and create application as subaccount
curl -k -X POST -H 'Accept: application/xml' -H 'X-Impersonate-User: c9sub' -d id=subd --user jhou:xxx https://ec2-23-20-185-7.compute-1.amazonaws.com/broker/rest/domains

curl -k -X POST -H 'Accept: application/xml' -H 'X-Impersonate-User: c9sub' -d name=c1 -d cartridge=php-5.3 -d gear_profile=c9 --user jhou:xxx https://ec2-23-20-185-7.compute-1.amazonaws.com/broker/rest/domains/subd/applications
3. Delete the application document from mongo
> db.applications.remove({name:"c1"})
4. On broker, oo-admin-chk

Actual results:
[root@ip-10-138-24-225 ~]# oo-admin-chk
Started at: 2013-07-05 05:04:08 -0400
Time to fetch mongo data: 0.012s
Total gears found in mongo: 3
Time to get all gears from nodes: 20.407s
Total gears found on the nodes: 4
Total nodes that responded : 1
Check failed.
Gear 51d68960205db86485000017 exists on node ip-10-138-24-225 (uid: 502) but does not exist in mongo database
Please refer to the oo-admin-repair tool to resolve some of these inconsistencies.
Total time: 20.421s
Finished at: 2013-07-05 05:04:29 -0400


Expected results:
Should success, oo-admin-chk should ignore subaccounts

Additional info:

Comment 1 Ravi Sankar 2013-07-05 19:12:07 UTC
This is an expected behavior.
Usage records are not created for subaccounts and oo-admin-chk will ignore comparing resources like gear/storage/premium-carts in applications mongo collection versus usage/usage_records mongo collection.
But we still need to ensure every gear on the node must have a valid gear record in applications mongo collection irrespective of whether it belongs to subaccount user or not.


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