one extra_specs key still exist when delete one flavor's two extra_specs keys at same time

Bug #1836439 reported by David Li
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Triaged
Low
Unassigned

Bug Description

1、posts two requests at same time to delete same flavor's two extra_specs keys
2、the two requests all get success from nova
3、finds only one extra_specs keys be deleted
that seems when handles the first delete request, the delete function of /nova/api/openstack/compute/flavors_extraspecs.py gets target flavor's all extra_specs info[1], and then saves the all extra_specs info except the deleted one again. However, the extra_specs info saved also contains the one that deleted by the seconde request[2][3][4].
see [1][2][3][4]:
[1]https://github.com/openstack/nova/blob/master/nova/api/openstack/compute/flavors_extraspecs.py#L118
[2] https://github.com/openstack/nova/blob/master/nova/objects/flavor.py#L531
[3] https://github.com/openstack/nova/blob/master/nova/objects/flavor.py#L480
[4] https://github.com/openstack/nova/blob/master/nova/objects/flavor.py#L483

David Li (ldone)
summary: - one extra spec key still exist when delete one flavor two extra_specs
- keys at same time
+ one extra_specs key still exist when delete one flavor's two
+ extra_specs keys at same time
David Li (ldone)
description: updated
description: updated
tags: added: race-condition
Revision history for this message
Matt Riedemann (mriedem) wrote :

Yeah without etags or generations this is kind of hard to enforce from a concurrency perspective in the API. There is a similar bug for updating server metadata concurrently.

Changed in nova:
status: New → Triaged
importance: Undecided → Low
Revision history for this message
Matt Riedemann (mriedem) wrote :

Bug 1650188 is the one for server metadata update concurrency.

Revision history for this message
David Li (ldone) wrote :

I wonder why we need to add in [1] when delete key. The function of func save_extra_specs is used to "Add or delete extra_specs", but it does add and delete extra_specs at one call. Also, I found it unnessary to do that, Should we recover its original function?
[1] https://github.com/openstack/nova/blob/master/nova/objects/flavor.py#L480

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.