yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #05359
[Bug 1212798] Re: quota_usages not decremented properly after per user quota migration
** Changed in: nova
Status: Fix Committed => Fix Released
--
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1212798
Title:
quota_usages not decremented properly after per user quota migration
Status in OpenStack Compute (Nova):
Fix Released
Bug description:
An example from a quota_usages table affected by
I24af1f6bc439d5d740303c6fe176a9bffe754579 as best I can tell. The
project_id in this case has 2 provisioned instances.
mysql> select * from quota_usages where project_id = '5853597';+---------------------+---------------------+------------+------+------------+-----------+--------+----------+---------------+---------+----------+
| created_at | updated_at | deleted_at | id | project_id | resource | in_use | reserved | until_refresh | deleted | user_id |
+---------------------+---------------------+------------+------+------------+-----------+--------+----------+---------------+---------+----------+
| 2013-04-22 19:57:31 | 2013-08-06 15:44:07 | NULL | 2595 | 5853597 | instances | 95 | 0 | NULL | 0 | NULL |
| 2013-04-22 19:57:31 | 2013-08-06 15:44:07 | NULL | 2596 | 5853597 | ram | 58880 | 0 | NULL | 0 | NULL |
| 2013-04-22 19:57:31 | 2013-08-06 15:44:07 | NULL | 2597 | 5853597 | cores | 95 | 0 | NULL | 0 | NULL |
| 2013-08-07 21:35:07 | 2013-08-15 17:33:53 | NULL | 3294 | 5853597 | instances | 2 | 0 | NULL | 0 | 10141776 |
| 2013-08-07 21:35:07 | 2013-08-15 17:33:53 | NULL | 3295 | 5853597 | ram | 1024 | 0 | NULL | 0 | 10141776 |
| 2013-08-07 21:35:07 | 2013-08-15 17:33:53 | NULL | 3296 | 5853597 | cores | 2 | 0 | NULL | 0 | 10141776 |
| 2013-08-12 15:18:02 | 2013-08-12 15:18:56 | NULL | 3575 | 5853597 | instances | 0 | 0 | NULL | 0 | 10085931 |
| 2013-08-12 15:18:02 | 2013-08-12 15:18:56 | NULL | 3576 | 5853597 | ram | 0 | 0 | NULL | 0 | 10085931 |
| 2013-08-12 15:18:02 | 2013-08-12 15:18:56 | NULL | 3577 | 5853597 | cores | 0 | 0 | NULL | 0 | 10085931 |
+---------------------+---------------------+------------+------+------------+-----------+--------+----------+---------------+---------+----------+
9 rows in set (0.00 sec)
The migration and code in I24af1f6bc439d5d740303c6fe176a9bffe754579
added a user_id column and support for tracking quota_usage by user.
What appears to be happening is when the user_id column is added the
current rows are left with a NULL user_id. So all further
quota_usages updates create and affect new rows and the user_id=NULL
rows are never updated again.
This becomes an issue because of the self healing for quota_usages.
In this case user_id 10141776 deleted the 95 instances that existed at
the time of the migration, but each time in_use goes negative there's
a sync method called in db/sqlalchemy/api.py:quota_reserve() which
sets it properly for that user but doesn't update the usage for the
NULL user.
To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1212798/+subscriptions