Bug 974019

Summary: [broker_50]oo-admin-chk can not recognize premium cartridge gears which have zero additional storage in applications but still have ADD_FS_GB usage records
Product: OpenShift Online Reporter: Xiaoli Tian <xtian>
Component: PodAssignee: Ravi Sankar <rpenta>
Status: CLOSED CURRENTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 2.xCC: rpenta, zzhao
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-06-24 14:54:25 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Xiaoli Tian 2013-06-13 09:57:46 UTC
Description of problem:
After set the additional_filesystem_gb for jbosseap-6.0 cartridge to zero in applications db and run oo-admin-chk -l 2 --verbose, it can not recognize the additional storage is zero in applications but it has ADD_FS_GB usage records.

Btw: for other non-premium cartridges, oo-admin-chk can recognize this mismatch correctly, it could return the message below for other non-premium cartridges:
Found usage record for addtl storage with gear Id '51b93a19c9c6fef25d000003' but could not find corresponding gear with addtl storage in the application.
Found usage record for addtl storage with gear Id '51b9741cc9c6fe4861000001' but could not find corresponding gear with addtl storage in the application.
Found usage record for addtl storage with gear Id '51b9754ec9c6fe486100001c' but could not find corresponding gear with addtl storage in the application.

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

How reproducible:
Always

Steps to Reproduce:
1. Create an jbosseap-6.0 application
rhc app create $appname jbosseap-6.0

2. setup the user's untracked storage to 6G, tracked stoage to 10G via oo-admin-ctl-user
oo-admin-ctl-user -l xtian+bt1 --setmaxtrackedstorage 10

oo-admin-ctl-user -l xtian+bt1 --setmaxuntrackedstorage 6

3. Add more  than untracked number storage to the cartridge

rhc cartridge-storage jbosseap-6.0 -a mjbosseap --add  10G

4.  Set additional_filesystem_gb to 0  from applications  mongo db

libra_rs:PRIMARY> db.applications.find({name:"mjbosseap"}, {"group_overrides.additional_filesystem_gb": 1})
{ "_id" : ObjectId("51b9741cc9c6fe4861000001"), "group_overrides" : [ { "additional_filesystem_gb" : 10 } ] }
libra_rs:PRIMARY> db.applications.update({name:"mjbosseap"}, {$set: {"group_overrides.0.additional_filesystem_gb": 0}})
 
 5. Run oo-admin-chk -l 2 --verbose

Actual results:
oo-admin-chk PASS without recognize the mismatch 

Expected results:

It should recognize the mismatch and display the mismatched gears like
Found usage record for addtl storage with gear Id '51b9754ec9c6fe486100001c' but could not find corresponding gear with addtl storage in the application.

Additional info:

Comment 1 Ravi Sankar 2013-06-14 04:59:45 UTC
Fixed in devenv_3360.

Comment 2 zhaozhanqi 2013-06-14 06:43:43 UTC
Tested this issue on devenv_3360, it has been fixed.


[root@ip-10-196-79-9 ~]# oo-admin-chk -l 1
Started at: 2013-06-14 02:25:46 -0400
Time to fetch mongo data: 0.085s
Total gears found in mongo: 4
Time to get all gears from nodes: 20.454s
Total gears found on the nodes: 4
Total nodes that responded : 1
Time to get all sshkeys for all gears from nodes: 20.055s
Total gears found on the nodes: 4
Total nodes that responded : 1
Checking un-ended records in usage_records collection but not in usage collection and viceversa: OK
Check failed.
Found usage record for addtl storage with gear Id '51baa68d8dc97ccbd1000003' but could not find corresponding gear with addtl storage in the application.
Please refer to the oo-admin-repair tool to resolve some of these inconsistencies.