e135a8221d
This new quota driver, ``DbQuotaNoLockDriver``, does not create a lock per (resource, project_id) but retrieves the instant (resource, project_id) usage and the current (resource, project_id) reservations. If the requested number of resources fit the available quota, a new ``Reservation`` register is created with the amount of units requested. All those operations are done inside a DB transaction context. That means the amount of resources and reservations is guaranteed inside this transaction (depending on the DB backend isolation level defined) and the new reservation created will not clash with other DB transation. That will guarantee the number of resources and instant reservations never exceed the quota limits defined for this (resource, project_id). NOTES: - This change tries to be as unobtrusive as possible. The new driver uses the same ``DbQuotaDriver`` dabatase tables (except for ``QuotaUsage``) and the same Quota engine API, located in ``neutron.quota``. However, the Quota engine resources implements some particular API actions like "dirty", that are not used in the new driver. - The Pecan Quota enforcement hooks, ``neutron.pecan_wgsi.hooks.quota_enforcement``, execute actions like "resync", "mark_resources_dirty" or "set_resources_dirty", that has no meaning in the new driver. - The isolation between the Quota engine and the Pecan hook, and the driver itself is not clearly defined. A refactor of the Quota engine, Quota service, Quota drivers and a common API between the driver and the engine is needed. - If ``DbQuotaDriver`` is deprecated, ``CountableResource`` and ``TrackedResource`` will be joined in a single class. This resource class will have a count method (countable) or a hard dependency on a database table (tracked resource). The only difference will be the "count" method implementation. Closes-Bug: #1926787 Change-Id: I4f98c6fcd781459fd7150aff426d19c7fdfa98c1
12 lines
619 B
YAML
12 lines
619 B
YAML
---
|
|
features:
|
|
- |
|
|
A new quota driver is added: ``DbQuotaNoLockDriver``. This driver, unlike
|
|
``DbQuotaDriver``, does not create a unique lock per (resource,
|
|
project_id). That may lead to a database deadlock state if the number of
|
|
server requests exceeds the number of resolved resource creations, as
|
|
described in `LP#1926787 <https://bugs.launchpad.net/neutron/+bug/1926787>`_.
|
|
This driver relays on the database transactionality isolation and counts
|
|
the number of used and reserved resources and, if available, creates the
|
|
new resource reservations in one single database transaction.
|