Quota driver "DbQuotaNoLockDriver" should implement "get_detailed_project_quotas"

Bug #1982962 reported by Rodolfo Alonso
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Medium
Rodolfo Alonso

Bug Description

Checking the logs, when the quota details are requested and "DbQuotaNoLockDriver" is loaded, some resources usages are "recalculated". E.g.:
  Quota usage for security_group_rule was recalculated. Used quota:13. count_used

The driver "DbQuotaNoLockDriver" does not use the database table "quotausages"; instead of this, the new method "DbQuotaNoLockDriver.get_detailed_project_quotas" should count directly from the database the resource count.

Related Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2102147

Changed in neutron:
assignee: nobody → Rodolfo Alonso (rodolfo-alonso-hernandez)
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/neutron/+/851357

Changed in neutron:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.opendev.org/c/openstack/neutron/+/851357
Committed: https://opendev.org/openstack/neutron/commit/bd60f0833bb439192140b7d04e0b01a5d63f0bb5
Submitter: "Zuul (22348)"
Branch: master

commit bd60f0833bb439192140b7d04e0b01a5d63f0bb5
Author: Rodolfo Alonso Hernandez <email address hidden>
Date: Wed Jul 27 17:55:48 2022 +0200

    Implement specific tracked resource count method per quota driver

    This patch implements a new method specific for each quota driver
    class. This method, "get_resource_count", returns the current number
    of resources created in a project of a tracked resource. A tracked
    resource is an instance of ``neutron.quota.resource.TrackedResource``.
    This method does not count the current reservations, just the actual
    resources created.

    This new method, "get_resource_count", will be added to the abstract
    class ``neutron_lib.db.quota_api.QuotaDriverAPI``.

    This patch also fixes ``TestDbQuotaDriverNoLock``, that was using a
    plugin inheriting from ``DbQuotaDriver`` instead of
    ``DbQuotaNoLockDriver``.

    Closes-Bug: #1982962

    Change-Id: I2707506468cb60d93a4459ea364f1e79faa83838

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

Fix proposed to branch: stable/yoga
Review: https://review.opendev.org/c/openstack/neutron/+/851915

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

Fix proposed to branch: stable/xena
Review: https://review.opendev.org/c/openstack/neutron/+/851918

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

Reviewed: https://review.opendev.org/c/openstack/neutron/+/851915
Committed: https://opendev.org/openstack/neutron/commit/ca96555e8168548f7c19e853f2242f501c945ff2
Submitter: "Zuul (22348)"
Branch: stable/yoga

commit ca96555e8168548f7c19e853f2242f501c945ff2
Author: Rodolfo Alonso Hernandez <email address hidden>
Date: Wed Jul 27 17:55:48 2022 +0200

    Implement specific tracked resource count method per quota driver

    This patch implements a new method specific for each quota driver
    class. This method, "get_resource_count", returns the current number
    of resources created in a project of a tracked resource. A tracked
    resource is an instance of ``neutron.quota.resource.TrackedResource``.
    This method does not count the current reservations, just the actual
    resources created.

    This new method, "get_resource_count", will be added to the abstract
    class ``neutron_lib.db.quota_api.QuotaDriverAPI``.

    This patch also fixes ``TestDbQuotaDriverNoLock``, that was using a
    plugin inheriting from ``DbQuotaDriver`` instead of
    ``DbQuotaNoLockDriver``.

    Closes-Bug: #1982962

    Conflicts:
      neutron/db/quota/driver_null.py

    Change-Id: I2707506468cb60d93a4459ea364f1e79faa83838
    (cherry picked from commit bd60f0833bb439192140b7d04e0b01a5d63f0bb5)

tags: added: in-stable-yoga
tags: added: in-stable-xena
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (stable/xena)

Reviewed: https://review.opendev.org/c/openstack/neutron/+/851918
Committed: https://opendev.org/openstack/neutron/commit/6ad3aab29c9bb08d9d711027eb9139ea43e90e9e
Submitter: "Zuul (22348)"
Branch: stable/xena

commit 6ad3aab29c9bb08d9d711027eb9139ea43e90e9e
Author: Rodolfo Alonso Hernandez <email address hidden>
Date: Wed Jul 27 17:55:48 2022 +0200

    Implement specific tracked resource count method per quota driver

    This patch implements a new method specific for each quota driver
    class. This method, "get_resource_count", returns the current number
    of resources created in a project of a tracked resource. A tracked
    resource is an instance of ``neutron.quota.resource.TrackedResource``.
    This method does not count the current reservations, just the actual
    resources created.

    This new method, "get_resource_count", will be added to the abstract
    class ``neutron_lib.db.quota_api.QuotaDriverAPI``.

    This patch also fixes ``TestDbQuotaDriverNoLock``, that was using a
    plugin inheriting from ``DbQuotaDriver`` instead of
    ``DbQuotaNoLockDriver``.

    Closes-Bug: #1982962

    Conflicts:
      neutron/db/quota/driver_null.py
      neutron/db/quota/driver.py
      neutron/quota/resource.py

    Change-Id: I2707506468cb60d93a4459ea364f1e79faa83838
    (cherry picked from commit bd60f0833bb439192140b7d04e0b01a5d63f0bb5)
    (cherry picked from commit ca96555e8168548f7c19e853f2242f501c945ff2)

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

This issue was fixed in the openstack/neutron 21.0.0.0rc1 release candidate.

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

This issue was fixed in the openstack/neutron 19.5.0 release.

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

This issue was fixed in the openstack/neutron 20.3.0 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.