race condition with resize causing old resources not to be free
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Expired
|
Undecided
|
Unassigned |
Bug Description
While I was working on fixing the resize for pci passthrough [1] I have notice the following issue in resize.
If you are using small image and you resize-confirm it very fast the old resources are not getting freed.
After debug this issue I found out the root cause of it.
A Good run of resize is as detailed below:
When doing resize the _update_
1. The first call we return the instance type of the new flavor and will enter this case
2. Then it will put in the tracked_migrations the migration and the new instance_type
3. The second call we return the old instance_type and will enter this case
4. Then in the tracked_migrations it will overwrite the old value with migration and the old instance type
5. https:/
6. When doing resize-confirm the drop_move_claim called with the old instance type
7. The drop_move_claim will compare the instance_type[id] from the tracked_migrations to the instance_type.id (which is the old one)
8. And because they are equals it will remove the old resource usage
But with small image like CirrOS and doing the revert-confirm fast the second call of _update_
The result is that when we enter the drop_move_claim it compares it with the new instance_type and this expression is false https:/
This mean that this code block is not executed https:/
tags: | added: compute resource-tracker |
Fix proposed to branch: master /review. openstack. org/327356
Review: https:/