You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cloudstack.apache.org by Olivier Lemasle <ol...@apalia.net> on 2014/06/07 10:26:33 UTC

Review Request 22339: CLOUDSTACK-6669: Fix support resize in usage server

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/22339/
-----------------------------------------------------------

Review request for cloudstack and Kishan Kavala.


Bugs: CLOUDSTACK-6669
    https://issues.apache.org/jira/browse/CLOUDSTACK-6669


Repository: cloudstack-git


Description
-------

This patch fixes the remaining bug in the initial fix for CLOUDSTACK-6669.
See my example here: https://issues.apache.org/jira/browse/CLOUDSTACK-6669?focusedCommentId=14020334


Diffs
-----

  usage/src/com/cloud/usage/parser/VolumeUsageParser.java cd092a9 

Diff: https://reviews.apache.org/r/22339/diff/


Testing
-------

1. Create a DATA volume with "Custom Disk", size 1GB
2. Resize it to "Custom Disk", size 3GB
3. Resize it to "Custom Disk", size 20GB
4. Change disk offering to "Medium Disk, 20GB"
5. Check cloud_usage database:

mysql> select * from usage_volume where id = 9;
+----+---------+------------+-----------+------------------+-------------+-------------+---------------------+---------------------+
| id | zone_id | account_id | domain_id | disk_offering_id | template_id | size        | created             | deleted             |
+----+---------+------------+-----------+------------------+-------------+-------------+---------------------+---------------------+
|  9 |       1 |          2 |         1 |                6 |        NULL |  1073741824 | 2014-06-07 07:00:01 | 2014-06-07 07:02:54 |
|  9 |       1 |          2 |         1 |                6 |        NULL |  3221225472 | 2014-06-07 07:02:54 | 2014-06-07 07:26:40 |
|  9 |       1 |          2 |         1 |                6 |        NULL | 21474836480 | 2014-06-07 07:26:40 | 2014-06-07 07:29:49 |
|  9 |       1 |          2 |         1 |                4 |        NULL | 21474836480 | 2014-06-07 07:29:49 | NULL                |
+----+---------+------------+-----------+------------------+-------------+-------------+---------------------+---------------------+

and:

mysql> select description, raw_usage, offering_id, size, start_date, end_date from cloud_usage where usage_id=9 and usage_type = 6;
+-------------------------------------------+--------------------+-------------+-------------+---------------------+---------------------+
| description                               | raw_usage          | offering_id | size        | start_date          | end_date            |
+-------------------------------------------+--------------------+-------------+-------------+---------------------+---------------------+
| Volume Id: 9 usage time (DiskOffering: 6) | 0.0480558350682259 |           6 |  1073741824 | 2014-06-07 06:55:00 | 2014-06-07 07:05:00 |
| Volume Id: 9 usage time (DiskOffering: 6) | 0.0350027792155743 |           6 |  3221225472 | 2014-06-07 06:55:00 | 2014-06-07 07:05:00 |
| Volume Id: 9 usage time (DiskOffering: 6) |  0.166666939854622 |           6 |  3221225472 | 2014-06-07 07:05:00 | 2014-06-07 07:15:00 |
| Volume Id: 9 usage time (DiskOffering: 6) |   0.16666667163372 |           6 |  3221225472 | 2014-06-07 07:15:00 | 2014-06-07 07:25:00 |
| Volume Id: 9 usage time (DiskOffering: 6) | 0.0277749989181757 |           6 |  3221225472 | 2014-06-07 07:25:00 | 2014-06-07 07:35:00 |
| Volume Id: 9 usage time (DiskOffering: 6) |  0.052500281482935 |           6 | 21474836480 | 2014-06-07 07:25:00 | 2014-06-07 07:35:00 |
| Volume Id: 9 usage time (DiskOffering: 4) | 0.0863919407129288 |           4 | 21474836480 | 2014-06-07 07:25:00 | 2014-06-07 07:35:00 |
+-------------------------------------------+--------------------+-------------+-------------+---------------------+---------------------+

We can see that usage records are duplicated when a volume has multiple sizes or multiple disk offerings on a given time range. Previously, usage records were aggregated, and size and offering_id were the values at the end of the period (see example https://issues.apache.org/jira/browse/CLOUDSTACK-6669?focusedCommentId=14020334)


Thanks,

Olivier Lemasle


Re: Review Request 22339: CLOUDSTACK-6669: Fix support resize in usage server

Posted by ASF Subversion and Git Services <as...@urd.zones.apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/22339/#review45005
-----------------------------------------------------------


Commit f0ea44daf12b702ab1deb03d4e6bc3adfab46efc in cloudstack's branch refs/heads/4.4-forward from Olivier Lemasle
[ https://git-wip-us.apache.org/repos/asf?p=cloudstack.git;h=f0ea44d ]

CLOUDSTACK-6669: Fix support resize in usage server

Signed-off-by: Sebastien Goasguen <ru...@gmail.com>


- ASF Subversion and Git Services


On June 7, 2014, 8:26 a.m., Olivier Lemasle wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/22339/
> -----------------------------------------------------------
> 
> (Updated June 7, 2014, 8:26 a.m.)
> 
> 
> Review request for cloudstack and Kishan Kavala.
> 
> 
> Bugs: CLOUDSTACK-6669
>     https://issues.apache.org/jira/browse/CLOUDSTACK-6669
> 
> 
> Repository: cloudstack-git
> 
> 
> Description
> -------
> 
> This patch fixes the remaining bug in the initial fix for CLOUDSTACK-6669.
> See my example here: https://issues.apache.org/jira/browse/CLOUDSTACK-6669?focusedCommentId=14020334
> 
> 
> Diffs
> -----
> 
>   usage/src/com/cloud/usage/parser/VolumeUsageParser.java cd092a9 
> 
> Diff: https://reviews.apache.org/r/22339/diff/
> 
> 
> Testing
> -------
> 
> 1. Create a DATA volume with "Custom Disk", size 1GB
> 2. Resize it to "Custom Disk", size 3GB
> 3. Resize it to "Custom Disk", size 20GB
> 4. Change disk offering to "Medium Disk, 20GB"
> 5. Check cloud_usage database:
> 
> mysql> select * from usage_volume where id = 9;
> +----+---------+------------+-----------+------------------+-------------+-------------+---------------------+---------------------+
> | id | zone_id | account_id | domain_id | disk_offering_id | template_id | size        | created             | deleted             |
> +----+---------+------------+-----------+------------------+-------------+-------------+---------------------+---------------------+
> |  9 |       1 |          2 |         1 |                6 |        NULL |  1073741824 | 2014-06-07 07:00:01 | 2014-06-07 07:02:54 |
> |  9 |       1 |          2 |         1 |                6 |        NULL |  3221225472 | 2014-06-07 07:02:54 | 2014-06-07 07:26:40 |
> |  9 |       1 |          2 |         1 |                6 |        NULL | 21474836480 | 2014-06-07 07:26:40 | 2014-06-07 07:29:49 |
> |  9 |       1 |          2 |         1 |                4 |        NULL | 21474836480 | 2014-06-07 07:29:49 | NULL                |
> +----+---------+------------+-----------+------------------+-------------+-------------+---------------------+---------------------+
> 
> and:
> 
> mysql> select description, raw_usage, offering_id, size, start_date, end_date from cloud_usage where usage_id=9 and usage_type = 6;
> +-------------------------------------------+--------------------+-------------+-------------+---------------------+---------------------+
> | description                               | raw_usage          | offering_id | size        | start_date          | end_date            |
> +-------------------------------------------+--------------------+-------------+-------------+---------------------+---------------------+
> | Volume Id: 9 usage time (DiskOffering: 6) | 0.0480558350682259 |           6 |  1073741824 | 2014-06-07 06:55:00 | 2014-06-07 07:05:00 |
> | Volume Id: 9 usage time (DiskOffering: 6) | 0.0350027792155743 |           6 |  3221225472 | 2014-06-07 06:55:00 | 2014-06-07 07:05:00 |
> | Volume Id: 9 usage time (DiskOffering: 6) |  0.166666939854622 |           6 |  3221225472 | 2014-06-07 07:05:00 | 2014-06-07 07:15:00 |
> | Volume Id: 9 usage time (DiskOffering: 6) |   0.16666667163372 |           6 |  3221225472 | 2014-06-07 07:15:00 | 2014-06-07 07:25:00 |
> | Volume Id: 9 usage time (DiskOffering: 6) | 0.0277749989181757 |           6 |  3221225472 | 2014-06-07 07:25:00 | 2014-06-07 07:35:00 |
> | Volume Id: 9 usage time (DiskOffering: 6) |  0.052500281482935 |           6 | 21474836480 | 2014-06-07 07:25:00 | 2014-06-07 07:35:00 |
> | Volume Id: 9 usage time (DiskOffering: 4) | 0.0863919407129288 |           4 | 21474836480 | 2014-06-07 07:25:00 | 2014-06-07 07:35:00 |
> +-------------------------------------------+--------------------+-------------+-------------+---------------------+---------------------+
> 
> We can see that usage records are duplicated when a volume has multiple sizes or multiple disk offerings on a given time range. Previously, usage records were aggregated, and size and offering_id were the values at the end of the period (see example https://issues.apache.org/jira/browse/CLOUDSTACK-6669?focusedCommentId=14020334)
> 
> 
> Thanks,
> 
> Olivier Lemasle
> 
>


Re: Review Request 22339: CLOUDSTACK-6669: Fix support resize in usage server

Posted by ASF Subversion and Git Services <as...@urd.zones.apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/22339/#review45012
-----------------------------------------------------------


Commit 6721701a54109fc44e7ee1675563c77802d348ce in cloudstack's branch refs/heads/4.4 from Olivier Lemasle
[ https://git-wip-us.apache.org/repos/asf?p=cloudstack.git;h=6721701 ]

CLOUDSTACK-6669: Fix support resize in usage server

Signed-off-by: Sebastien Goasguen <ru...@gmail.com>
(cherry picked from commit f0ea44daf12b702ab1deb03d4e6bc3adfab46efc)


- ASF Subversion and Git Services


On June 7, 2014, 8:26 a.m., Olivier Lemasle wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/22339/
> -----------------------------------------------------------
> 
> (Updated June 7, 2014, 8:26 a.m.)
> 
> 
> Review request for cloudstack and Kishan Kavala.
> 
> 
> Bugs: CLOUDSTACK-6669
>     https://issues.apache.org/jira/browse/CLOUDSTACK-6669
> 
> 
> Repository: cloudstack-git
> 
> 
> Description
> -------
> 
> This patch fixes the remaining bug in the initial fix for CLOUDSTACK-6669.
> See my example here: https://issues.apache.org/jira/browse/CLOUDSTACK-6669?focusedCommentId=14020334
> 
> 
> Diffs
> -----
> 
>   usage/src/com/cloud/usage/parser/VolumeUsageParser.java cd092a9 
> 
> Diff: https://reviews.apache.org/r/22339/diff/
> 
> 
> Testing
> -------
> 
> 1. Create a DATA volume with "Custom Disk", size 1GB
> 2. Resize it to "Custom Disk", size 3GB
> 3. Resize it to "Custom Disk", size 20GB
> 4. Change disk offering to "Medium Disk, 20GB"
> 5. Check cloud_usage database:
> 
> mysql> select * from usage_volume where id = 9;
> +----+---------+------------+-----------+------------------+-------------+-------------+---------------------+---------------------+
> | id | zone_id | account_id | domain_id | disk_offering_id | template_id | size        | created             | deleted             |
> +----+---------+------------+-----------+------------------+-------------+-------------+---------------------+---------------------+
> |  9 |       1 |          2 |         1 |                6 |        NULL |  1073741824 | 2014-06-07 07:00:01 | 2014-06-07 07:02:54 |
> |  9 |       1 |          2 |         1 |                6 |        NULL |  3221225472 | 2014-06-07 07:02:54 | 2014-06-07 07:26:40 |
> |  9 |       1 |          2 |         1 |                6 |        NULL | 21474836480 | 2014-06-07 07:26:40 | 2014-06-07 07:29:49 |
> |  9 |       1 |          2 |         1 |                4 |        NULL | 21474836480 | 2014-06-07 07:29:49 | NULL                |
> +----+---------+------------+-----------+------------------+-------------+-------------+---------------------+---------------------+
> 
> and:
> 
> mysql> select description, raw_usage, offering_id, size, start_date, end_date from cloud_usage where usage_id=9 and usage_type = 6;
> +-------------------------------------------+--------------------+-------------+-------------+---------------------+---------------------+
> | description                               | raw_usage          | offering_id | size        | start_date          | end_date            |
> +-------------------------------------------+--------------------+-------------+-------------+---------------------+---------------------+
> | Volume Id: 9 usage time (DiskOffering: 6) | 0.0480558350682259 |           6 |  1073741824 | 2014-06-07 06:55:00 | 2014-06-07 07:05:00 |
> | Volume Id: 9 usage time (DiskOffering: 6) | 0.0350027792155743 |           6 |  3221225472 | 2014-06-07 06:55:00 | 2014-06-07 07:05:00 |
> | Volume Id: 9 usage time (DiskOffering: 6) |  0.166666939854622 |           6 |  3221225472 | 2014-06-07 07:05:00 | 2014-06-07 07:15:00 |
> | Volume Id: 9 usage time (DiskOffering: 6) |   0.16666667163372 |           6 |  3221225472 | 2014-06-07 07:15:00 | 2014-06-07 07:25:00 |
> | Volume Id: 9 usage time (DiskOffering: 6) | 0.0277749989181757 |           6 |  3221225472 | 2014-06-07 07:25:00 | 2014-06-07 07:35:00 |
> | Volume Id: 9 usage time (DiskOffering: 6) |  0.052500281482935 |           6 | 21474836480 | 2014-06-07 07:25:00 | 2014-06-07 07:35:00 |
> | Volume Id: 9 usage time (DiskOffering: 4) | 0.0863919407129288 |           4 | 21474836480 | 2014-06-07 07:25:00 | 2014-06-07 07:35:00 |
> +-------------------------------------------+--------------------+-------------+-------------+---------------------+---------------------+
> 
> We can see that usage records are duplicated when a volume has multiple sizes or multiple disk offerings on a given time range. Previously, usage records were aggregated, and size and offering_id were the values at the end of the period (see example https://issues.apache.org/jira/browse/CLOUDSTACK-6669?focusedCommentId=14020334)
> 
> 
> Thanks,
> 
> Olivier Lemasle
> 
>


Re: Review Request 22339: CLOUDSTACK-6669: Fix support resize in usage server

Posted by ASF Subversion and Git Services <as...@urd.zones.apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/22339/#review45004
-----------------------------------------------------------


Commit 303e6ffc1e36a5d1ba2a1d48093f996fef1614df in cloudstack's branch refs/heads/master from Olivier Lemasle
[ https://git-wip-us.apache.org/repos/asf?p=cloudstack.git;h=303e6ff ]

CLOUDSTACK-6669: Fix support resize in usage server

Signed-off-by: Sebastien Goasguen <ru...@gmail.com>


- ASF Subversion and Git Services


On June 7, 2014, 8:26 a.m., Olivier Lemasle wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/22339/
> -----------------------------------------------------------
> 
> (Updated June 7, 2014, 8:26 a.m.)
> 
> 
> Review request for cloudstack and Kishan Kavala.
> 
> 
> Bugs: CLOUDSTACK-6669
>     https://issues.apache.org/jira/browse/CLOUDSTACK-6669
> 
> 
> Repository: cloudstack-git
> 
> 
> Description
> -------
> 
> This patch fixes the remaining bug in the initial fix for CLOUDSTACK-6669.
> See my example here: https://issues.apache.org/jira/browse/CLOUDSTACK-6669?focusedCommentId=14020334
> 
> 
> Diffs
> -----
> 
>   usage/src/com/cloud/usage/parser/VolumeUsageParser.java cd092a9 
> 
> Diff: https://reviews.apache.org/r/22339/diff/
> 
> 
> Testing
> -------
> 
> 1. Create a DATA volume with "Custom Disk", size 1GB
> 2. Resize it to "Custom Disk", size 3GB
> 3. Resize it to "Custom Disk", size 20GB
> 4. Change disk offering to "Medium Disk, 20GB"
> 5. Check cloud_usage database:
> 
> mysql> select * from usage_volume where id = 9;
> +----+---------+------------+-----------+------------------+-------------+-------------+---------------------+---------------------+
> | id | zone_id | account_id | domain_id | disk_offering_id | template_id | size        | created             | deleted             |
> +----+---------+------------+-----------+------------------+-------------+-------------+---------------------+---------------------+
> |  9 |       1 |          2 |         1 |                6 |        NULL |  1073741824 | 2014-06-07 07:00:01 | 2014-06-07 07:02:54 |
> |  9 |       1 |          2 |         1 |                6 |        NULL |  3221225472 | 2014-06-07 07:02:54 | 2014-06-07 07:26:40 |
> |  9 |       1 |          2 |         1 |                6 |        NULL | 21474836480 | 2014-06-07 07:26:40 | 2014-06-07 07:29:49 |
> |  9 |       1 |          2 |         1 |                4 |        NULL | 21474836480 | 2014-06-07 07:29:49 | NULL                |
> +----+---------+------------+-----------+------------------+-------------+-------------+---------------------+---------------------+
> 
> and:
> 
> mysql> select description, raw_usage, offering_id, size, start_date, end_date from cloud_usage where usage_id=9 and usage_type = 6;
> +-------------------------------------------+--------------------+-------------+-------------+---------------------+---------------------+
> | description                               | raw_usage          | offering_id | size        | start_date          | end_date            |
> +-------------------------------------------+--------------------+-------------+-------------+---------------------+---------------------+
> | Volume Id: 9 usage time (DiskOffering: 6) | 0.0480558350682259 |           6 |  1073741824 | 2014-06-07 06:55:00 | 2014-06-07 07:05:00 |
> | Volume Id: 9 usage time (DiskOffering: 6) | 0.0350027792155743 |           6 |  3221225472 | 2014-06-07 06:55:00 | 2014-06-07 07:05:00 |
> | Volume Id: 9 usage time (DiskOffering: 6) |  0.166666939854622 |           6 |  3221225472 | 2014-06-07 07:05:00 | 2014-06-07 07:15:00 |
> | Volume Id: 9 usage time (DiskOffering: 6) |   0.16666667163372 |           6 |  3221225472 | 2014-06-07 07:15:00 | 2014-06-07 07:25:00 |
> | Volume Id: 9 usage time (DiskOffering: 6) | 0.0277749989181757 |           6 |  3221225472 | 2014-06-07 07:25:00 | 2014-06-07 07:35:00 |
> | Volume Id: 9 usage time (DiskOffering: 6) |  0.052500281482935 |           6 | 21474836480 | 2014-06-07 07:25:00 | 2014-06-07 07:35:00 |
> | Volume Id: 9 usage time (DiskOffering: 4) | 0.0863919407129288 |           4 | 21474836480 | 2014-06-07 07:25:00 | 2014-06-07 07:35:00 |
> +-------------------------------------------+--------------------+-------------+-------------+---------------------+---------------------+
> 
> We can see that usage records are duplicated when a volume has multiple sizes or multiple disk offerings on a given time range. Previously, usage records were aggregated, and size and offering_id were the values at the end of the period (see example https://issues.apache.org/jira/browse/CLOUDSTACK-6669?focusedCommentId=14020334)
> 
> 
> Thanks,
> 
> Olivier Lemasle
> 
>


Re: Review Request 22339: CLOUDSTACK-6669: Fix support resize in usage server

Posted by Olivier Lemasle <ol...@apalia.net>.

> On June 7, 2014, 10:39 a.m., Sebastien Goasguen wrote:
> > Which branch should this be applied to ?

I've tested it in branch 4.4.
It should work on master (because commit bdde5335f99 was applied on master and 4.4)


- Olivier


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/22339/#review45003
-----------------------------------------------------------


On June 7, 2014, 10:26 a.m., Olivier Lemasle wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/22339/
> -----------------------------------------------------------
> 
> (Updated June 7, 2014, 10:26 a.m.)
> 
> 
> Review request for cloudstack and Kishan Kavala.
> 
> 
> Bugs: CLOUDSTACK-6669
>     https://issues.apache.org/jira/browse/CLOUDSTACK-6669
> 
> 
> Repository: cloudstack-git
> 
> 
> Description
> -------
> 
> This patch fixes the remaining bug in the initial fix for CLOUDSTACK-6669.
> See my example here: https://issues.apache.org/jira/browse/CLOUDSTACK-6669?focusedCommentId=14020334
> 
> 
> Diffs
> -----
> 
>   usage/src/com/cloud/usage/parser/VolumeUsageParser.java cd092a9 
> 
> Diff: https://reviews.apache.org/r/22339/diff/
> 
> 
> Testing
> -------
> 
> 1. Create a DATA volume with "Custom Disk", size 1GB
> 2. Resize it to "Custom Disk", size 3GB
> 3. Resize it to "Custom Disk", size 20GB
> 4. Change disk offering to "Medium Disk, 20GB"
> 5. Check cloud_usage database:
> 
> mysql> select * from usage_volume where id = 9;
> +----+---------+------------+-----------+------------------+-------------+-------------+---------------------+---------------------+
> | id | zone_id | account_id | domain_id | disk_offering_id | template_id | size        | created             | deleted             |
> +----+---------+------------+-----------+------------------+-------------+-------------+---------------------+---------------------+
> |  9 |       1 |          2 |         1 |                6 |        NULL |  1073741824 | 2014-06-07 07:00:01 | 2014-06-07 07:02:54 |
> |  9 |       1 |          2 |         1 |                6 |        NULL |  3221225472 | 2014-06-07 07:02:54 | 2014-06-07 07:26:40 |
> |  9 |       1 |          2 |         1 |                6 |        NULL | 21474836480 | 2014-06-07 07:26:40 | 2014-06-07 07:29:49 |
> |  9 |       1 |          2 |         1 |                4 |        NULL | 21474836480 | 2014-06-07 07:29:49 | NULL                |
> +----+---------+------------+-----------+------------------+-------------+-------------+---------------------+---------------------+
> 
> and:
> 
> mysql> select description, raw_usage, offering_id, size, start_date, end_date from cloud_usage where usage_id=9 and usage_type = 6;
> +-------------------------------------------+--------------------+-------------+-------------+---------------------+---------------------+
> | description                               | raw_usage          | offering_id | size        | start_date          | end_date            |
> +-------------------------------------------+--------------------+-------------+-------------+---------------------+---------------------+
> | Volume Id: 9 usage time (DiskOffering: 6) | 0.0480558350682259 |           6 |  1073741824 | 2014-06-07 06:55:00 | 2014-06-07 07:05:00 |
> | Volume Id: 9 usage time (DiskOffering: 6) | 0.0350027792155743 |           6 |  3221225472 | 2014-06-07 06:55:00 | 2014-06-07 07:05:00 |
> | Volume Id: 9 usage time (DiskOffering: 6) |  0.166666939854622 |           6 |  3221225472 | 2014-06-07 07:05:00 | 2014-06-07 07:15:00 |
> | Volume Id: 9 usage time (DiskOffering: 6) |   0.16666667163372 |           6 |  3221225472 | 2014-06-07 07:15:00 | 2014-06-07 07:25:00 |
> | Volume Id: 9 usage time (DiskOffering: 6) | 0.0277749989181757 |           6 |  3221225472 | 2014-06-07 07:25:00 | 2014-06-07 07:35:00 |
> | Volume Id: 9 usage time (DiskOffering: 6) |  0.052500281482935 |           6 | 21474836480 | 2014-06-07 07:25:00 | 2014-06-07 07:35:00 |
> | Volume Id: 9 usage time (DiskOffering: 4) | 0.0863919407129288 |           4 | 21474836480 | 2014-06-07 07:25:00 | 2014-06-07 07:35:00 |
> +-------------------------------------------+--------------------+-------------+-------------+---------------------+---------------------+
> 
> We can see that usage records are duplicated when a volume has multiple sizes or multiple disk offerings on a given time range. Previously, usage records were aggregated, and size and offering_id were the values at the end of the period (see example https://issues.apache.org/jira/browse/CLOUDSTACK-6669?focusedCommentId=14020334)
> 
> 
> Thanks,
> 
> Olivier Lemasle
> 
>


Re: Review Request 22339: CLOUDSTACK-6669: Fix support resize in usage server

Posted by Sebastien Goasguen <ru...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/22339/#review45003
-----------------------------------------------------------


Which branch should this be applied to ?

- Sebastien Goasguen


On June 7, 2014, 8:26 a.m., Olivier Lemasle wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/22339/
> -----------------------------------------------------------
> 
> (Updated June 7, 2014, 8:26 a.m.)
> 
> 
> Review request for cloudstack and Kishan Kavala.
> 
> 
> Bugs: CLOUDSTACK-6669
>     https://issues.apache.org/jira/browse/CLOUDSTACK-6669
> 
> 
> Repository: cloudstack-git
> 
> 
> Description
> -------
> 
> This patch fixes the remaining bug in the initial fix for CLOUDSTACK-6669.
> See my example here: https://issues.apache.org/jira/browse/CLOUDSTACK-6669?focusedCommentId=14020334
> 
> 
> Diffs
> -----
> 
>   usage/src/com/cloud/usage/parser/VolumeUsageParser.java cd092a9 
> 
> Diff: https://reviews.apache.org/r/22339/diff/
> 
> 
> Testing
> -------
> 
> 1. Create a DATA volume with "Custom Disk", size 1GB
> 2. Resize it to "Custom Disk", size 3GB
> 3. Resize it to "Custom Disk", size 20GB
> 4. Change disk offering to "Medium Disk, 20GB"
> 5. Check cloud_usage database:
> 
> mysql> select * from usage_volume where id = 9;
> +----+---------+------------+-----------+------------------+-------------+-------------+---------------------+---------------------+
> | id | zone_id | account_id | domain_id | disk_offering_id | template_id | size        | created             | deleted             |
> +----+---------+------------+-----------+------------------+-------------+-------------+---------------------+---------------------+
> |  9 |       1 |          2 |         1 |                6 |        NULL |  1073741824 | 2014-06-07 07:00:01 | 2014-06-07 07:02:54 |
> |  9 |       1 |          2 |         1 |                6 |        NULL |  3221225472 | 2014-06-07 07:02:54 | 2014-06-07 07:26:40 |
> |  9 |       1 |          2 |         1 |                6 |        NULL | 21474836480 | 2014-06-07 07:26:40 | 2014-06-07 07:29:49 |
> |  9 |       1 |          2 |         1 |                4 |        NULL | 21474836480 | 2014-06-07 07:29:49 | NULL                |
> +----+---------+------------+-----------+------------------+-------------+-------------+---------------------+---------------------+
> 
> and:
> 
> mysql> select description, raw_usage, offering_id, size, start_date, end_date from cloud_usage where usage_id=9 and usage_type = 6;
> +-------------------------------------------+--------------------+-------------+-------------+---------------------+---------------------+
> | description                               | raw_usage          | offering_id | size        | start_date          | end_date            |
> +-------------------------------------------+--------------------+-------------+-------------+---------------------+---------------------+
> | Volume Id: 9 usage time (DiskOffering: 6) | 0.0480558350682259 |           6 |  1073741824 | 2014-06-07 06:55:00 | 2014-06-07 07:05:00 |
> | Volume Id: 9 usage time (DiskOffering: 6) | 0.0350027792155743 |           6 |  3221225472 | 2014-06-07 06:55:00 | 2014-06-07 07:05:00 |
> | Volume Id: 9 usage time (DiskOffering: 6) |  0.166666939854622 |           6 |  3221225472 | 2014-06-07 07:05:00 | 2014-06-07 07:15:00 |
> | Volume Id: 9 usage time (DiskOffering: 6) |   0.16666667163372 |           6 |  3221225472 | 2014-06-07 07:15:00 | 2014-06-07 07:25:00 |
> | Volume Id: 9 usage time (DiskOffering: 6) | 0.0277749989181757 |           6 |  3221225472 | 2014-06-07 07:25:00 | 2014-06-07 07:35:00 |
> | Volume Id: 9 usage time (DiskOffering: 6) |  0.052500281482935 |           6 | 21474836480 | 2014-06-07 07:25:00 | 2014-06-07 07:35:00 |
> | Volume Id: 9 usage time (DiskOffering: 4) | 0.0863919407129288 |           4 | 21474836480 | 2014-06-07 07:25:00 | 2014-06-07 07:35:00 |
> +-------------------------------------------+--------------------+-------------+-------------+---------------------+---------------------+
> 
> We can see that usage records are duplicated when a volume has multiple sizes or multiple disk offerings on a given time range. Previously, usage records were aggregated, and size and offering_id were the values at the end of the period (see example https://issues.apache.org/jira/browse/CLOUDSTACK-6669?focusedCommentId=14020334)
> 
> 
> Thanks,
> 
> Olivier Lemasle
> 
>


Re: Review Request 22339: CLOUDSTACK-6669: Fix support resize in usage server

Posted by Sebastien Goasguen <ru...@gmail.com>.

> On June 7, 2014, 8:48 a.m., Sebastien Goasguen wrote:
> > Ship It!

applied to master, and 4.4-forward. Sent a request to cherry-pick on 4.4

Thanks for the patch


- Sebastien


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/22339/#review45007
-----------------------------------------------------------


On June 7, 2014, 8:26 a.m., Olivier Lemasle wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/22339/
> -----------------------------------------------------------
> 
> (Updated June 7, 2014, 8:26 a.m.)
> 
> 
> Review request for cloudstack and Kishan Kavala.
> 
> 
> Bugs: CLOUDSTACK-6669
>     https://issues.apache.org/jira/browse/CLOUDSTACK-6669
> 
> 
> Repository: cloudstack-git
> 
> 
> Description
> -------
> 
> This patch fixes the remaining bug in the initial fix for CLOUDSTACK-6669.
> See my example here: https://issues.apache.org/jira/browse/CLOUDSTACK-6669?focusedCommentId=14020334
> 
> 
> Diffs
> -----
> 
>   usage/src/com/cloud/usage/parser/VolumeUsageParser.java cd092a9 
> 
> Diff: https://reviews.apache.org/r/22339/diff/
> 
> 
> Testing
> -------
> 
> 1. Create a DATA volume with "Custom Disk", size 1GB
> 2. Resize it to "Custom Disk", size 3GB
> 3. Resize it to "Custom Disk", size 20GB
> 4. Change disk offering to "Medium Disk, 20GB"
> 5. Check cloud_usage database:
> 
> mysql> select * from usage_volume where id = 9;
> +----+---------+------------+-----------+------------------+-------------+-------------+---------------------+---------------------+
> | id | zone_id | account_id | domain_id | disk_offering_id | template_id | size        | created             | deleted             |
> +----+---------+------------+-----------+------------------+-------------+-------------+---------------------+---------------------+
> |  9 |       1 |          2 |         1 |                6 |        NULL |  1073741824 | 2014-06-07 07:00:01 | 2014-06-07 07:02:54 |
> |  9 |       1 |          2 |         1 |                6 |        NULL |  3221225472 | 2014-06-07 07:02:54 | 2014-06-07 07:26:40 |
> |  9 |       1 |          2 |         1 |                6 |        NULL | 21474836480 | 2014-06-07 07:26:40 | 2014-06-07 07:29:49 |
> |  9 |       1 |          2 |         1 |                4 |        NULL | 21474836480 | 2014-06-07 07:29:49 | NULL                |
> +----+---------+------------+-----------+------------------+-------------+-------------+---------------------+---------------------+
> 
> and:
> 
> mysql> select description, raw_usage, offering_id, size, start_date, end_date from cloud_usage where usage_id=9 and usage_type = 6;
> +-------------------------------------------+--------------------+-------------+-------------+---------------------+---------------------+
> | description                               | raw_usage          | offering_id | size        | start_date          | end_date            |
> +-------------------------------------------+--------------------+-------------+-------------+---------------------+---------------------+
> | Volume Id: 9 usage time (DiskOffering: 6) | 0.0480558350682259 |           6 |  1073741824 | 2014-06-07 06:55:00 | 2014-06-07 07:05:00 |
> | Volume Id: 9 usage time (DiskOffering: 6) | 0.0350027792155743 |           6 |  3221225472 | 2014-06-07 06:55:00 | 2014-06-07 07:05:00 |
> | Volume Id: 9 usage time (DiskOffering: 6) |  0.166666939854622 |           6 |  3221225472 | 2014-06-07 07:05:00 | 2014-06-07 07:15:00 |
> | Volume Id: 9 usage time (DiskOffering: 6) |   0.16666667163372 |           6 |  3221225472 | 2014-06-07 07:15:00 | 2014-06-07 07:25:00 |
> | Volume Id: 9 usage time (DiskOffering: 6) | 0.0277749989181757 |           6 |  3221225472 | 2014-06-07 07:25:00 | 2014-06-07 07:35:00 |
> | Volume Id: 9 usage time (DiskOffering: 6) |  0.052500281482935 |           6 | 21474836480 | 2014-06-07 07:25:00 | 2014-06-07 07:35:00 |
> | Volume Id: 9 usage time (DiskOffering: 4) | 0.0863919407129288 |           4 | 21474836480 | 2014-06-07 07:25:00 | 2014-06-07 07:35:00 |
> +-------------------------------------------+--------------------+-------------+-------------+---------------------+---------------------+
> 
> We can see that usage records are duplicated when a volume has multiple sizes or multiple disk offerings on a given time range. Previously, usage records were aggregated, and size and offering_id were the values at the end of the period (see example https://issues.apache.org/jira/browse/CLOUDSTACK-6669?focusedCommentId=14020334)
> 
> 
> Thanks,
> 
> Olivier Lemasle
> 
>


Re: Review Request 22339: CLOUDSTACK-6669: Fix support resize in usage server

Posted by Sebastien Goasguen <ru...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/22339/#review45007
-----------------------------------------------------------

Ship it!


Ship It!

- Sebastien Goasguen


On June 7, 2014, 8:26 a.m., Olivier Lemasle wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/22339/
> -----------------------------------------------------------
> 
> (Updated June 7, 2014, 8:26 a.m.)
> 
> 
> Review request for cloudstack and Kishan Kavala.
> 
> 
> Bugs: CLOUDSTACK-6669
>     https://issues.apache.org/jira/browse/CLOUDSTACK-6669
> 
> 
> Repository: cloudstack-git
> 
> 
> Description
> -------
> 
> This patch fixes the remaining bug in the initial fix for CLOUDSTACK-6669.
> See my example here: https://issues.apache.org/jira/browse/CLOUDSTACK-6669?focusedCommentId=14020334
> 
> 
> Diffs
> -----
> 
>   usage/src/com/cloud/usage/parser/VolumeUsageParser.java cd092a9 
> 
> Diff: https://reviews.apache.org/r/22339/diff/
> 
> 
> Testing
> -------
> 
> 1. Create a DATA volume with "Custom Disk", size 1GB
> 2. Resize it to "Custom Disk", size 3GB
> 3. Resize it to "Custom Disk", size 20GB
> 4. Change disk offering to "Medium Disk, 20GB"
> 5. Check cloud_usage database:
> 
> mysql> select * from usage_volume where id = 9;
> +----+---------+------------+-----------+------------------+-------------+-------------+---------------------+---------------------+
> | id | zone_id | account_id | domain_id | disk_offering_id | template_id | size        | created             | deleted             |
> +----+---------+------------+-----------+------------------+-------------+-------------+---------------------+---------------------+
> |  9 |       1 |          2 |         1 |                6 |        NULL |  1073741824 | 2014-06-07 07:00:01 | 2014-06-07 07:02:54 |
> |  9 |       1 |          2 |         1 |                6 |        NULL |  3221225472 | 2014-06-07 07:02:54 | 2014-06-07 07:26:40 |
> |  9 |       1 |          2 |         1 |                6 |        NULL | 21474836480 | 2014-06-07 07:26:40 | 2014-06-07 07:29:49 |
> |  9 |       1 |          2 |         1 |                4 |        NULL | 21474836480 | 2014-06-07 07:29:49 | NULL                |
> +----+---------+------------+-----------+------------------+-------------+-------------+---------------------+---------------------+
> 
> and:
> 
> mysql> select description, raw_usage, offering_id, size, start_date, end_date from cloud_usage where usage_id=9 and usage_type = 6;
> +-------------------------------------------+--------------------+-------------+-------------+---------------------+---------------------+
> | description                               | raw_usage          | offering_id | size        | start_date          | end_date            |
> +-------------------------------------------+--------------------+-------------+-------------+---------------------+---------------------+
> | Volume Id: 9 usage time (DiskOffering: 6) | 0.0480558350682259 |           6 |  1073741824 | 2014-06-07 06:55:00 | 2014-06-07 07:05:00 |
> | Volume Id: 9 usage time (DiskOffering: 6) | 0.0350027792155743 |           6 |  3221225472 | 2014-06-07 06:55:00 | 2014-06-07 07:05:00 |
> | Volume Id: 9 usage time (DiskOffering: 6) |  0.166666939854622 |           6 |  3221225472 | 2014-06-07 07:05:00 | 2014-06-07 07:15:00 |
> | Volume Id: 9 usage time (DiskOffering: 6) |   0.16666667163372 |           6 |  3221225472 | 2014-06-07 07:15:00 | 2014-06-07 07:25:00 |
> | Volume Id: 9 usage time (DiskOffering: 6) | 0.0277749989181757 |           6 |  3221225472 | 2014-06-07 07:25:00 | 2014-06-07 07:35:00 |
> | Volume Id: 9 usage time (DiskOffering: 6) |  0.052500281482935 |           6 | 21474836480 | 2014-06-07 07:25:00 | 2014-06-07 07:35:00 |
> | Volume Id: 9 usage time (DiskOffering: 4) | 0.0863919407129288 |           4 | 21474836480 | 2014-06-07 07:25:00 | 2014-06-07 07:35:00 |
> +-------------------------------------------+--------------------+-------------+-------------+---------------------+---------------------+
> 
> We can see that usage records are duplicated when a volume has multiple sizes or multiple disk offerings on a given time range. Previously, usage records were aggregated, and size and offering_id were the values at the end of the period (see example https://issues.apache.org/jira/browse/CLOUDSTACK-6669?focusedCommentId=14020334)
> 
> 
> Thanks,
> 
> Olivier Lemasle
> 
>