Incorrect results for tenant usage

Bug #1796689 reported by Lucian Petrut
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Lucian Petrut
Ocata
In Progress
Medium
melanie witt
Pike
Fix Released
Medium
Elod Illes
Queens
Fix Committed
Medium
Elod Illes
Rocky
Fix Committed
Medium
Lucian Petrut

Bug Description

nova usage-list can return incorrect results, having resources counted twice. This only occurs when using the 2.40 microversion or later.

http://paste.openstack.org/raw/731560/

This microversion introduced pagination, which doesn't work properly. Nova API will sort the instances using the tenant id and instance uuid, but 'os-simple-tenant-usage' will not preserve the order when returning the results.

For this reason, subsequent API calls made by the client will use the wrong marker (which is supposed to be the last instance id), ending up counting the same instances twice.

Tags: api
Changed in nova:
assignee: nobody → Lucian Petrut (petrutlucian94)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/608685

Changed in nova:
status: New → In Progress
Matt Riedemann (mriedem)
tags: added: api
Changed in nova:
importance: Undecided → Medium
Changed in nova:
assignee: Lucian Petrut (petrutlucian94) → Matt Riedemann (mriedem)
Matt Riedemann (mriedem)
Changed in nova:
assignee: Matt Riedemann (mriedem) → Lucian Petrut (petrutlucian94)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/608685
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=afc3a16ce3364c233e6e1cffc9f38987d1d65318
Submitter: Zuul
Branch: master

commit afc3a16ce3364c233e6e1cffc9f38987d1d65318
Author: Lucian Petrut <email address hidden>
Date: Mon Oct 8 17:13:55 2018 +0300

    Fix os-simple-tenant-usage result order

    nova usage-list can return incorrect results, having resources counted
    twice. This only occurs when using the 2.40 microversion or later.

    This microversion introduced pagination, which doesn't work properly.
    Nova API will sort the instances using the tenant id and instance uuid,
    but 'os-simple-tenant-usage' will not preserve the order when returning
    the results.

    For this reason, subsequent API calls made by the client will use the
    wrong marker (which is supposed to be the last instance id), ending
    up counting the same instances twice.

    Change-Id: I6c7a67b23ec49aa207c33c38580acd834bb27e3c
    Closes-Bug: #1796689

Changed in nova:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (stable/rocky)

Fix proposed to branch: stable/rocky
Review: https://review.openstack.org/613853

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (stable/rocky)

Reviewed: https://review.openstack.org/613853
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=133b194ba079abe84900d09a5c3c74ef9f464bab
Submitter: Zuul
Branch: stable/rocky

commit 133b194ba079abe84900d09a5c3c74ef9f464bab
Author: Lucian Petrut <email address hidden>
Date: Mon Oct 8 17:13:55 2018 +0300

    Fix os-simple-tenant-usage result order

    nova usage-list can return incorrect results, having resources counted
    twice. This only occurs when using the 2.40 microversion or later.

    This microversion introduced pagination, which doesn't work properly.
    Nova API will sort the instances using the tenant id and instance uuid,
    but 'os-simple-tenant-usage' will not preserve the order when returning
    the results.

    For this reason, subsequent API calls made by the client will use the
    wrong marker (which is supposed to be the last instance id), ending
    up counting the same instances twice.

    Change-Id: I6c7a67b23ec49aa207c33c38580acd834bb27e3c
    Closes-Bug: #1796689
    (cherry picked from commit afc3a16ce3364c233e6e1cffc9f38987d1d65318)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/nova 18.1.0

This issue was fixed in the openstack/nova 18.1.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (stable/queens)

Fix proposed to branch: stable/queens
Review: https://review.openstack.org/632516

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (stable/queens)

Reviewed: https://review.openstack.org/632516
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=70b4cdce68f9b1543c032aa700e4f0f4289d90a6
Submitter: Zuul
Branch: stable/queens

commit 70b4cdce68f9b1543c032aa700e4f0f4289d90a6
Author: Lucian Petrut <email address hidden>
Date: Mon Oct 8 17:13:55 2018 +0300

    Fix os-simple-tenant-usage result order

    nova usage-list can return incorrect results, having resources counted
    twice. This only occurs when using the 2.40 microversion or later.

    This microversion introduced pagination, which doesn't work properly.
    Nova API will sort the instances using the tenant id and instance uuid,
    but 'os-simple-tenant-usage' will not preserve the order when returning
    the results.

    For this reason, subsequent API calls made by the client will use the
    wrong marker (which is supposed to be the last instance id), ending
    up counting the same instances twice.

    Change-Id: I6c7a67b23ec49aa207c33c38580acd834bb27e3c
    Closes-Bug: #1796689
    (cherry picked from commit afc3a16ce3364c233e6e1cffc9f38987d1d65318)
    (cherry picked from commit 133b194ba079abe84900d09a5c3c74ef9f464bab)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/nova 19.0.0.0rc1

This issue was fixed in the openstack/nova 19.0.0.0rc1 release candidate.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/nova 17.0.10

This issue was fixed in the openstack/nova 17.0.10 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (stable/pike)

Fix proposed to branch: stable/pike
Review: https://review.opendev.org/709600

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (stable/ocata)

Fix proposed to branch: stable/ocata
Review: https://review.opendev.org/709603

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (stable/pike)

Reviewed: https://review.opendev.org/709600
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=f8a721ae85cab44754b8e64434e90f4c2afa89aa
Submitter: Zuul
Branch: stable/pike

commit f8a721ae85cab44754b8e64434e90f4c2afa89aa
Author: Lucian Petrut <email address hidden>
Date: Mon Oct 8 17:13:55 2018 +0300

    Fix os-simple-tenant-usage result order

    nova usage-list can return incorrect results, having resources counted
    twice. This only occurs when using the 2.40 microversion or later.

    This microversion introduced pagination, which doesn't work properly.
    Nova API will sort the instances using the tenant id and instance uuid,
    but 'os-simple-tenant-usage' will not preserve the order when returning
    the results.

    For this reason, subsequent API calls made by the client will use the
    wrong marker (which is supposed to be the last instance id), ending
    up counting the same instances twice.

    NOTE(melwitt): The differences from the Queens change in the sample
    .tpl and .json files are because change
    I3b25debb0bcfd4e211734307c8d363f2b5dbc655 is not in Pike, so there
    are only two generated UUIDs per server (instance UUID and vif UUID)
    instead of three (instance UUID, vif UUID, and bdm UUID).

    Change-Id: I6c7a67b23ec49aa207c33c38580acd834bb27e3c
    Closes-Bug: #1796689
    (cherry picked from commit afc3a16ce3364c233e6e1cffc9f38987d1d65318)
    (cherry picked from commit 133b194ba079abe84900d09a5c3c74ef9f464bab)
    (cherry picked from commit 70b4cdce68f9b1543c032aa700e4f0f4289d90a6)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on nova (stable/ocata)

Change abandoned by "Elod Illes <email address hidden>" on branch: stable/ocata
Review: https://review.opendev.org/c/openstack/nova/+/709603
Reason: stable/ocata of openstack/nova transitioned to End of Life ( https://review.opendev.org/c/openstack/releases/+/795664 ), to be able to delete the branch we need to abandon all open patches on the branch.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/nova pike-eol

This issue was fixed in the openstack/nova pike-eol release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.