Quota usage value error in batch create share

Bug #1707378 reported by zhongjun on 2017-07-29
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Manila
Low
Unassigned

Bug Description

Steps to reproduce:

We create multiple shares at the same time, and run in different share-api services.

# manila create NFS 1
# manila create NFS 1
# manila create NFS 1
# manila create NFS 1

mysql> select * from quota_usages;
+---------------------+---------------------+------------+---------+----+----------------------------------+----------------------------------+----------------+--------+----------+---------------+--------------------------------------+
| created_at | updated_at | deleted_at | deleted | id | user_id | project_id | resource | in_use | reserved | until_refresh | share_type_id |
+---------------------+---------------------+------------+---------+----+----------------------------------+----------------------------------+----------------+--------+----------+---------------+--------------------------------------+
| 2017-07-25 20:29:53 | 2017-07-27 02:42:01 | NULL | 0 | 1 | d450d728853a452d9f20b8ff98b9f279 | e23850eeb91d4fa3866af634223e454c | gigabytes | 2 | 0 | NULL | NULL |
| 2017-07-25 20:29:53 | 2017-07-27 02:42:01 | NULL | 0 | 2 | d450d728853a452d9f20b8ff98b9f279 | e23850eeb91d4fa3866af634223e454c | shares | 2 | 0 | NULL | NULL |
| 2017-07-25 20:32:43 | 2017-07-27 02:42:01 | NULL | 0 | 3 | NULL | e23850eeb91d4fa3866af634223e454c | gigabytes | 2 | 0 | NULL | 14ff61bc-a3b1-4c3d-9e2e-e5074e01531e |
| 2017-07-25 20:32:43 | 2017-07-27 02:42:01 | NULL | 0 | 4 | NULL | e23850eeb91d4fa3866af634223e454c | shares | 2 | 0 | NULL | 14ff61bc-a3b1-4c3d-9e2e-e5074e01531e |
| 2017-07-26 03:02:45 | 2017-07-26 03:03:29 | NULL | 0 | 5 | NULL | e23850eeb91d4fa3866af634223e454c | gigabytes | 0 | 0 | NULL | 5eca3a82-abfc-4adc-a78e-886669bc0e36 |
| 2017-07-26 03:02:45 | 2017-07-26 03:03:29 | NULL | 0 | 6 | NULL | e23850eeb91d4fa3866af634223e454c | shares | 0 | 0 | NULL | 5eca3a82-abfc-4adc-a78e-886669bc0e36 |
| 2017-07-26 03:02:55 | 2017-07-26 03:03:07 | NULL | 0 | 7 | NULL | e23850eeb91d4fa3866af634223e454c | gigabytes | 0 | 0 | NULL | 16cd9d7f-1d2e-4fb8-a273-a43f8c6bf245 |
| 2017-07-26 03:02:55 | 2017-07-26 03:03:07 | NULL | 0 | 8 | NULL | e23850eeb91d4fa3866af634223e454c | shares | 0 | 0 | NULL | 16cd9d7f-1d2e-4fb8-a273-a43f8c6bf245 |
| 2017-07-26 07:46:09 | 2017-07-26 09:46:00 | NULL | 0 | 9 | d450d728853a452d9f20b8ff98b9f279 | e23850eeb91d4fa3866af634223e454c | share_networks | 0 | 0 | NULL | NULL |
| 2017-07-26 09:32:15 | 2017-07-26 09:32:41 | NULL | 0 | 10 | NULL | e23850eeb91d4fa3866af634223e454c | gigabytes | 0 | 0 | NULL | 14ff61bc-a3b1-4c3d-9e2e-e5074e01531e |
| 2017-07-26 09:32:15 | 2017-07-26 09:32:41 | NULL | 0 | 11 | NULL | e23850eeb91d4fa3866af634223e454c | shares | 0 | 0 | NULL | 14ff61bc-a3b1-4c3d-9e2e-e5074e01531e |
| 2017-07-26 09:32:26 | 2017-07-26 09:32:37 | NULL | 0 | 12 | NULL | e23850eeb91d4fa3866af634223e454c | gigabytes | 0 | 0 | NULL | 3d1b78e4-d8a1-4fe0-a23c-305ef3ae3275 |
| 2017-07-26 09:32:26 | 2017-07-26 09:32:37 | NULL | 0 | 13 | NULL | e23850eeb91d4fa3866af634223e454c | shares | 0 | 0 | NULL | 3d1b78e4-d8a1-4fe0-a23c-305ef3ae3275 |
+---------------------+---------------------+------------+---------+----+----------------------------------+----------------------------------+----------------+--------+----------+---------------+--------------------------------------+

We got the redundant record with same user_id, same project_id and same share_type_id.

zhongjun (jun-zhongjun) on 2017-08-01
summary: - Quota usage value error
+ Quota usage value error in batch create share
zhongjun (jun-zhongjun) on 2017-08-01
description: updated
description: updated
Changed in manila:
milestone: none → pike-rc1
assignee: nobody → zhongjun (jun-zhongjun)
importance: Undecided → High
status: New → Triaged
Changed in manila:
status: Triaged → In Progress
zhongjun (jun-zhongjun) wrote :

We have two or more ways to fix this bug,
1. We could combine the quota record in db if these quota's user_id, project_id and share_type_id etc at the same when we create a share.
2. The quota reserve and commit model has many problems [1]. We could just remove the quota model in the code.

We could discuss it in PTG or another meeting to decide how to resolve this bug.

[1] https://specs.openstack.org/openstack/nova-specs/specs/pike/approved/cells-count-resources-to-check-quota-in-api.html

Changed in manila:
status: In Progress → Incomplete
Changed in manila:
milestone: pike-rc1 → queens-1
Tom Barron (tpb) on 2018-06-19
tags: added: quotas
Jason Grosso (jgrosso) on 2019-01-29
Changed in manila:
status: Incomplete → Confirmed
status: Confirmed → Incomplete
Tom Barron (tpb) on 2019-03-17
Changed in manila:
assignee: zhongjun (jun-zhongjun) → nobody
milestone: queens-1 → none
Jason Grosso (jgrosso) wrote :

Hi Zhongjun is there any progress with this are you still seeing an issue?

zhongjun (jun-zhongjun) wrote :

sorry, it isn't any progress with this.

Jason Grosso (jgrosso) wrote :

Was this defect discussed at the PTG in Denver?

Jason Grosso (jgrosso) on 2019-06-13
Changed in manila:
importance: High → Low
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers