cloudstack-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <>
Subject [jira] [Commented] (CLOUDSTACK-9161) Quota Service: fix marvin test
Date Mon, 14 Dec 2015 10:35:46 GMT


ASF GitHub Bot commented on CLOUDSTACK-9161:

Github user agneya2001 commented on a diff in the pull request:
    --- Diff: plugins/database/quota/src/org/apache/cloudstack/api/response/
    @@ -186,7 +186,7 @@ public int compare(QuotaBalanceVO o1, QuotaBalanceVO o2) {
             //check that there is at least one balance entry
             for (Iterator<QuotaBalanceVO> it = quotaBalance.iterator(); it.hasNext();)
                 QuotaBalanceVO entry =;
    -            if (entry.getCreditsId() > 0) {
    +            if (entry.getCreditsId() == 0) {
    --- End diff --
    @DaanHoogland good that you are probing the logic.
    In a system where quota service has never run, there could be credit entries a admin may
want to add some credit entries even before quota service has run. So at a point the db can
have credit entries without any real balance entry. There could be a situation where there
is a balance entry after several credit entries followed by another set of credit entries.
    When there is a balance entry it consolidates all the credit entries that happened before
    So when calculating balance you need to add all the credit entries that happened after
a balance entry while ignoring all the credit entries that happened before the first balance
entry. You till need to show all the credit entries that happened in between for the balance
    When marvin tests were run the db was clean with only one credit entry. This was a special
case where you add all the credit entries to show the final balance but you still need to
show this credit entry in the balance statement. If quota service has run once it makes a
0 balance entry as part of bootstrapping.
    entry.getCreditsId() == 0, looks for real balance entry. A credit id that is non-zero
refers to a credit entry with id being the credit id.

> Quota Service: fix marvin test
> ------------------------------
>                 Key: CLOUDSTACK-9161
>                 URL:
>             Project: CloudStack
>          Issue Type: Bug
>      Security Level: Public(Anyone can view this level - this is the default.) 
>    Affects Versions: 4.7.0
>            Reporter: Abhinandan Prateek
>            Assignee: Abhinandan Prateek
>            Priority: Critical
>             Fix For: 4.7.0
> the two tests in marvin tests are failing.

This message was sent by Atlassian JIRA

View raw message