Quota info in DB for floatingip is not updated immediately
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
neutron |
Fix Released
|
Undecided
|
Sergey Belous |
Bug Description
The records in quotausages table for floatingip are not updated immediately after delete some (or all) floatingips.
For example, if we set quota for floatingip to 5, create 5 floatingips and remove all of them, after that we can't create new floatingip:
The error "Quota exceeded for resources: ['floatingip']." occurs.
And at this time in mysql db we can see following:
mysql> select * from quotausages;
+------
| tenant_id | resource | dirty | in_use | reserved |
+------
| fae4b729e0d5431
| fae4b729e0d5431
+------
Steps to reproduce:
1. $ neutron quota-update --floatingip 5
2. $ for i in $(seq 1 5); do neutron floatingip-create public; done
3. Try to create another one floatingip (should not be created):
$ neutron floatingip-create public
Quota exceeded for resources: ['floatingip'].
4. $ for ip in $(neutron floatingip-list -f csv -c id --quote=none | grep -v id); do neutron floatingip-delete $ip done
5. Try to create another one floatingip:
$ neutron floatingip-create public
Quota exceeded for resources: ['floatingip'].
6. Check quotas info in db:
mysql> use neutron
mysql> select * from quotausages;
Full log here: http://
summary: |
- Quota info in bd for floatingip is not updated immediately + Quota info in DB for floatingip is not updated immediately |
description: | updated |
description: | updated |
description: | updated |
Changed in neutron: | |
assignee: | nobody → Sergey Belous (sbelous) |
Changed in neutron: | |
status: | New → In Progress |
It is even worse than that. I can see big differences in my setup between actually allocated floating IPs and the value in the quotausages table. See https:/ /bugs.launchpad .net/mos/ +bug/1527581.
mysql> SELECT q.tenant_ id,q.in_ use,COUNT( f.floating_ ip_address) AS floating_ips FROM quotausages q LEFT JOIN floatingips f USING(tenant_id) WHERE q.resource= 'floatingip' GROUP BY q.tenant_id; ------- ------- ------- ------- +------ --+---- ------- ---+ ------- ------- ------- ------- +------ --+---- ------- ---+ 79af078d4c22f3f 08 | 4 | 4 | b8c275fe2ff90c1 db | 2 | 2 | 2a6778e09ba588e c0 | 10 | 0 | 9aed0d33a8d5e8e ee | 19 | 19 | 79708649ae64a9d 85 | 1 | 0 | ba1d334e2613346 1d | 5 | 5 | ------- ------- ------- ------- +------ --+---- ------- ---+
+------
| tenant_id | in_use | floating_ips |
+------
| 08609b63401f436
| 3a1e97ffa74f429
| 7829521236b143d
| 8d04de0a40cc441
| d7400e965d5a40a
| f62d544271e6416
+------
6 rows in set (0.00 sec)