Bug 997352 - oo-admin-chk cannot find out the inconsistent between usage collection and usage_record collection in mongodb
Summary: oo-admin-chk cannot find out the inconsistent between usage collection and us...
Keywords:
Status: CLOSED CURRENTRELEASE
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-08-15 08:59 UTC by Meng Bo
Modified: 2015-05-15 00:19 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-08-29 12:51:29 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Meng Bo 2013-08-15 08:59:19 UTC
Description of problem:
Create app, and remove the app entry from usage collection in mongodb. Use oo-admin-chk to check the usage issue.

It will report success and cannot find out the problem.

# oo-admin-chk -l1 -v
Checking un-ended records in usage_records collection but not in usage collection and viceversa: OK


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

How reproducible:
always

Steps to Reproduce:
1.Create app
2.Remove the usage of this app from mongodb
#mongo openshift_broker_dev
> db.usage.remove({"app_name":"$appname"})

3.Use oo-admin-chk to check the usage issue

Actual results:
# oo-admin-chk -l1 -v
Checking un-ended records in usage_records collection but not in usage collection and viceversa: OK

Expected results:
Found #{usage_record_unended_events-usage_unended_events} un-ended records in usage_records collection for gear Id '#{gear_id}' but could not find corresponding records in usage

Additional info:
billing is enabled

# irb
irb(main):002:0> require "/var/www/openshift/broker/config/environment"
=> true
irb(main):003:0> Rails.configuration.respond_to?('billing')
=> true

Comment 1 Ravi Sankar 2013-08-20 01:02:35 UTC
Fixed in https://github.com/openshift/origin-server/pull/3421

Comment 2 openshift-github-bot 2013-08-20 06:05:14 UTC
Commits pushed to master at https://github.com/openshift/origin-server

https://github.com/openshift/origin-server/commit/f7781425fb61fa0f80f59d34df8f462e9f5a439f
Bug 997352 - Added usage_record -> usage inconsistency checks

https://github.com/openshift/origin-server/commit/3d448f5ddb1f22e0e3a236dc933b38ebbc74ec0e
Merge pull request #3421 from pravisankar/dev/ravi/bug997352

Merged by openshift-bot

Comment 3 Meng Bo 2013-08-20 10:47:13 UTC
Checking un-ended records in usage_records collection but not in usage collection and viceversa: FAIL
Re-checking for gear '521341369f776ebba900001a'...	FAIL
Re-checking for gear '521342039f776ebba900003d'...	FAIL
Re-checking for gear '5213428e9f776eff0d000002'...	FAIL
Re-checking for gear '521343419f776eff0d000018'...	FAIL
Check failed.
Found usage record for gear Id '521343419f776eff0d000018' but could not find corresponding gear in the application.
Found 1 un-ended records in usage_records collection for gear Id '521341369f776ebba900001a' but could not find corresponding records in usage.
Found 1 un-ended records in usage_records collection for gear Id '521342039f776ebba900003d' but could not find corresponding records in usage.
Found 1 un-ended records in usage_records collection for gear Id '5213428e9f776eff0d000002' but could not find corresponding records in usage.
Found 1 un-ended records in usage_records collection for gear Id '521343419f776eff0d000018' but could not find corresponding records in usage.
Please refer to the oo-admin-repair tool to resolve some of these inconsistencies.
Total time: 40.711s
Finished at: 2013-08-20 06:41:27 -0400


Issue fixed on devenv_3678, move bug to verified.


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