This patch deals with the lock wait timeout and the deadlock errors
observed under high concurrency (api_workers >= 4) with the pymysql
driver. It includes the following changes:
- Stop setting dirty status for resource usage when creating
reservation, as usage of reserved resources is not tracked anymore;
- Add a variable, increasing delay when retrying make_reservation
upon a DBDeadlock error in order to reduce the chances of further
collisions;
- Enable transaction retry upon DBDeadlock errors for set_quota_usage;
- Do not resync quota usage while making reservation. This puts a lot
of stress on the database and is also wasteful since resource usage
is very likely to change again once the transaction is committed;
- Use autonested_transaction to simplify logic around when the
nested flag should be used.
Reviewed: https:/ /review. openstack. org/216640 /git.openstack. org/cgit/ openstack/ neutron/ commit/ ?id=7da1724d446 b6804c6be7a6025 32fbae58d9f008
Committed: https:/
Submitter: Jenkins
Branch: master
commit 7da1724d446b680 4c6be7a602532fb ae58d9f008
Author: Salvatore Orlando <email address hidden>
Date: Tue Aug 25 02:21:06 2015 -0700
Improve DB operations for quota reservation
This patch deals with the lock wait timeout and the deadlock errors
observed under high concurrency (api_workers >= 4) with the pymysql
driver. It includes the following changes:
- Stop setting dirty status for resource usage when creating transaction to simplify logic around when the
reservation, as usage of reserved resources is not tracked anymore;
- Add a variable, increasing delay when retrying make_reservation
upon a DBDeadlock error in order to reduce the chances of further
collisions;
- Enable transaction retry upon DBDeadlock errors for set_quota_usage;
- Do not resync quota usage while making reservation. This puts a lot
of stress on the database and is also wasteful since resource usage
is very likely to change again once the transaction is committed;
- Use autonested_
nested flag should be used.
Change-Id: I7a335f9ebea3c0 d6fee6e6b757554 e045a66075c Blueprint: better-quotas
Closes-Bug: #1486134
Related-