Reviewed: https://review.opendev.org/c/openstack/neutron/+/805031 Committed: https://opendev.org/openstack/neutron/commit/1146a4d09176a214d0751c3dda899bdb033998ad Submitter: "Zuul (22348)" Branch: master
commit 1146a4d09176a214d0751c3dda899bdb033998ad Author: Rodolfo Alonso Hernandez <[email protected]> Date: Wed Aug 18 13:04:08 2021 +0000 Do not fail when releasing a quota reservation The quota reservation release (deletion) is done at the end of a server call to create a new resource (or resources). The quota drivers implemented have mechanisms to clean up the expired reservations when calculating the resource quota. If a reservation deletion fails, the API call should not be retried. Instead of this, the reservation should be left and collected by the quota driver clean up mechanisms. This patch also adds a timeout delay for expired reservations in ``DbQuotaNoLockDriver``. Now this driver deletes any existing reservation created ``RESERVATION_EXPIRATION_TIMEOUT = 20`` (seconds) before. It is assumed that any reservation should be released before this time (regardless if the resource is created or not). Closes-Bug: #1940311 Change-Id: I155c401ec5e2fe6e3af6390855852764ee983cf5 ** Changed in: neutron Status: In Progress => Fix Released -- You received this bug notification because you are a member of Yahoo! Engineering Team, which is subscribed to neutron. https://bugs.launchpad.net/bugs/1940311 Title: Quota engine should not retry DB operation when releasing reservation Status in neutron: Fix Released Bug description: If Quota engine fails during the reservation release, that will retrigger the whole API operation again. That means, for example, if a new security group was requested, two of them will be created [1]. Any API operation that creates a new resource (or resources), will create first a reservation. Then, when the resource (or resources) are created, the reservation is deleted. At this point, when the reservation is going to be deleted, the resource is consistently created in the DB. If the reservation deletion fails, the Neutron API will retry the whole operation, including the resource creation. The quota API exposes a single method [2] used to release any reservation made. This method is called from "DbQuotaDriver" and "DbQuotaNoLockDriver" (the only quota drivers implemented, discarding "NullQuotaDriver"). Both drivers implement methods to clean any expired reservation; that means, any older reservation present in the system is automatically removed. Proposal: - For "DbQuotaNoLockDriver", increase the expired reservation timeout (now is zero, that's an error). - For [2], do not fail and retry if DB error. In case of DB error, we can just continue and leave the reservation deletion to the automatic deletion system. [1]Related bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1993130 [2]https://github.com/openstack/neutron/blob/96f1ea140edb1386159ce8b103c48b4e6a816ca1/neutron/db/quota/api.py#L202 To manage notifications about this bug go to: https://bugs.launchpad.net/neutron/+bug/1940311/+subscriptions -- Mailing list: https://launchpad.net/~yahoo-eng-team Post to : [email protected] Unsubscribe : https://launchpad.net/~yahoo-eng-team More help : https://help.launchpad.net/ListHelp

