Deleted flavor influences new flavor with same id in 'flavor-show' under psql
Bug #1288636 reported by
wingwj
This bug affects 2 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Fix Released
|
Low
|
wingwj | ||
Havana |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
When you create a new flavor with a deleted flavorid, the result in mysql will show the new record. That's OK.
But if you operate these commands under psql, you'll find the result will always be the old deleted one.
That means, the flavorid will always be occupied by the first record who use this flavorid under psql,
even if this flavor has already been deleted.
More info can be found at here: http://
Changed in nova: | |
assignee: | nobody → wingwj (wingwj) |
Changed in nova: | |
importance: | Undecided → Low |
Changed in nova: | |
milestone: | none → icehouse-rc1 |
Changed in nova: | |
status: | Fix Committed → Fix Released |
Changed in nova: | |
milestone: | icehouse-rc1 → 2014.1 |
To post a comment you must log in.
I checked the sql used in 'flavor-show', through the sqlalchemy framework, the sql for mysql and psql is almost the same.
The core sql is like this:
--------------
'SELECT instance_ types.created_ at AS instance_ types_created_ at, instance_ types.updated_ at AS instance_ types_updated_ at, instance_ types.deleted_ at AS instance_ types_deleted_ at, instance_ types.deleted AS instance_ types_deleted, instance_types.id AS instance_types_id, instance_types.name AS instance_ types_name, instance_ types.memory_ mb AS instance_ types_memory_ mb, instance_ types.vcpus AS instance_ types_vcpus, instance_ types.root_ gb AS instance_ types_root_ gb, instance_ types.ephemeral _gb AS instance_ types_ephemeral _gb, instance_ types.flavorid AS instance_ types_flavorid, instance_types.swap AS instance_ types_swap, instance_ types.rxtx_ factor AS instance_ types_rxtx_ factor, instance_ types.vcpu_ weight AS instance_ types_vcpu_ weight, instance_ types.disabled AS instance_ types_disabled, instance_ types.is_ public AS instance_ types_is_ public types.flavorid = E'666'
FROM instance_types
WHERE instance_
LIMIT 1',
--------------
I inputted "select * from instance_types where flavorid='xxx'; " in mysql and psql respectively, paste.openstack .org/show/ 72763/
the result is difference: http://
The response of "select * from where" is the same with "select * from" under psql.
The new non-deleted record locates at the bottom.
But the new deleted one under mysql is on the top.
--------------
Therefore, plus 'LIMIT 1' in sql, 'flavor-show' under psql will always show the oldest one.
And the mysql will always give the non-deleted one correctly.