Bug 1012782 - The addition gear storage stored in 'applications' and 'usage_records' collections are different, causing oo-admin-chk fail validation
The addition gear storage stored in 'applications' and 'usage_records' collec...
Product: OpenShift Online
Classification: Red Hat
Component: Pod (Show other bugs)
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: Ravi Sankar
libra bugs
Depends On:
  Show dependency treegraph
Reported: 2013-09-27 02:40 EDT by Jianwei Hou
Modified: 2015-05-14 20:21 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2013-10-17 09:32:18 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Jianwei Hou 2013-09-27 02:40:17 EDT
Description of problem:
Given 10G maxtrackedstorage is added to an account, when I added 15G additional storage to a gear, the value of additional_filesystem_gb in 'applications' collection is stored as 15, while the values of 'addtl_fs_gb' in 'usage_records' and 'usage' collections are stored as 10. This makes oo-admin-chk fails validation.

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

How reproducible:

Steps to Reproduce:
1. Grand 10 maxtrackedstorage to current account
oo-admin-ctl-user -l $user --setmaxtrackedstorage 10
2. Create an application, add 15G storage(default 5G storage for silver plan + granted 10G storage)
3. oo-admin-chk -l 1

Actual results:
After step 3:
Check failed.
Found addtl storage mismatch for gear Id '5245220f4a8a1a0f380000f2', 10 in usage record vs 15 for corresponding gear in the application.
Please refer to the oo-admin-repair tool to resolve some of these inconsistencies.

Checking applications:
ip-10-238-166-43(mongod-2.4.6)[PRIMARY] openshift_broker_dev> db.applications.find({"name":"r19s"},{name:1, group_overrides:1})
  "_id": ObjectId("5245220f4a8a1a0f380000f2"),
  "group_overrides": [
      "components": [
          "cart": "ruby-1.9",
          "comp": "ruby-1.9"
      "min_gears": 1,
      "additional_filesystem_gb": 15,
      "max_gears": 1
  "name": "r19s"

ip-10-238-166-43(mongod-2.4.6)[PRIMARY] openshift_broker_dev> db.usage_records.find({"app_name":"r19s"},{addtl_fs_gb:1})
  "_id": ObjectId("5245222c4a8a1a0f38000111"),
  "event": "begin",
  "time": ISODate("2013-09-27T02:14:04.633-0400"),
  "created_at": ISODate("2013-09-27T02:14:04.633-0400"),
  "gear_id": ObjectId("5245220f4a8a1a0f380000f2"),
  "usage_type": "ADDTL_FS_GB",
  "user_id": ObjectId("5244e92d4a8a1af7ab000001"),
  "app_name": "r19s",
  "addtl_fs_gb": 10,
  "updated_at": ISODate("2013-09-27T02:14:04.637-0400")

The additionl gear storage stored in above 2 collections are different

Expected results:
Should store the same value and oo-admin-chk should pass validation

Additional info:
Comment 1 Ravi Sankar 2013-09-27 20:23:39 EDT
Fixed in https://github.com/openshift/origin-server/pull/3733

Fixed oo-admin-chk script.For the example in the description, Additional gear storage in applications collection will be 15 and in usage_records collection will be 10. We capture only tracked additional storage (in this case 5GB untracked storage is discounted).
Comment 2 openshift-github-bot 2013-09-27 22:09:27 EDT
Commits pushed to master at https://github.com/openshift/origin-server

Bug 1012782 - oo-admin-chk fix

Merge pull request #3733 from pravisankar/dev/ravi/bug1012782

Merged by openshift-bot
Comment 3 Jianwei Hou 2013-09-28 23:01:30 EDT
Verified on devenv_3844, untracked gear storage will not be counted in by oo-admin-chk. Verification steps are as description.

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