instance_group_delete() filters related entities by group UUID rather than by ID
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Fix Released
|
Undecided
|
Roman Podoliaka |
Bug Description
Table 'instance_groups' has two columns to unambiguously identify the specific row:
1) id (Integer, primary_key=True, autoincrement=True)
2) uuid (String)
The former is used internally to bind related entities by FKs (InstanceGroupM
Having two 'id' columns is both misleading and error-prone. E. g. instance_
def instance_
"""Delete an group."""
session = get_session()
with session.begin():
count = _instance_
if count == 0:
raise exception.
# Delete policies, metadata and members
for model in instance_models:
Related entities are filtered by 'group_id' column, but 'group_uuid' value is passed. Despite that these two columns are of different types, this statement is executed successfully on MySQL and SQLite (though WHERE clause never evaluates to True, so related entities aren't actually deleted), but fails on PostgreSQL, which is more strict when checking data types of values.
Changed in nova: | |
assignee: | nobody → Roman Podolyaka (rpodolyaka) |
Changed in nova: | |
milestone: | none → havana-3 |
status: | Fix Committed → Fix Released |
Changed in nova: | |
milestone: | havana-3 → 2013.2 |
Fix proposed to branch: master /review. openstack. org/41408
Review: https:/