missing UC on virtual_interfaces.address in sqlite

Bug #1156227 reported by Boris Pavlovic
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Yuriy Zveryanskyy

Bug Description

This affects only sqlite: (So probably it is not so important)

In sqlite we are not able to drop Constraints so we are not able to drop columns with constraints.
And deleted columns have type of Boolean which in sqlite has constraint (in (0,1))

So only way that I found was to use shadow tables. (Create new table with correct type of deleted) and copy data from old table to new.. and then drop old table and rename new to old name.

Unfortunately there is probably one more bug in sqlalchemy, for some reason there is no uC in table's constraints.
So we lost all UC in sqlite that ware used.

There is only one table with such problem virtual_interfaces.address (Currently I am working on tests)

To fix this bug I should add one more db.migration.

I think that this is not so important and could wait for Havana. How do you think?

By the way, I think that we should remove UC on address and make it on
(address, deleted). Then we will be able to use soft_delete instead of delete. So probably it is better to fix it in Havana-1.

Tags: db
Changed in nova:
assignee: nobody → Boris Pavlovic (boris-42)
status: New → Incomplete
status: Incomplete → New
description: updated
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/24606

Changed in nova:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/24606
Committed: http://github.com/openstack/nova/commit/ac0c8d41c683a3bd00aa2d33a03b20a5c7a6f83c
Submitter: Jenkins
Branch: master

commit ac0c8d41c683a3bd00aa2d33a03b20a5c7a6f83c
Author: Boris Pavlovic <email address hidden>
Date: Sun Mar 17 23:31:56 2013 +0400

    Add missing tests for db.virtual_interface_* methods

    There was no tests in test_db_api for virtual_interface_* methods.

    Add tests to ensure that all works.

    This allow us to refactor these methods to use soft_delete instead of
    delete.

    Found bug 1156227 in sqlite we have lost UC on virtual_interfaces.address
    after 152_* migration. To fix it we should add new db migration, so it will be
    fixed in Havana-1.

    blueprint db-api-tests

    Change-Id: Ide03163b230762d65bf3cd7b5fe8f0a303fea5ae

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → grizzly-rc1
status: Fix Committed → Fix Released
Changed in nova:
status: Fix Released → Confirmed
importance: Undecided → Medium
milestone: grizzly-rc1 → havana-1
Changed in nova:
milestone: havana-1 → none
Changed in nova:
milestone: none → havana-2
status: Confirmed → In Progress
Changed in nova:
assignee: Boris Pavlovic (boris-42) → Yuriy Zveryanskyy (yzveryanskyy)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.openstack.org/33299
Committed: http://github.com/openstack/nova/commit/01b87a1ae18d3c5098163c2558da884c880c9749
Submitter: Jenkins
Branch: master

commit 01b87a1ae18d3c5098163c2558da884c880c9749
Author: Yuriy Zveryanskyy <email address hidden>
Date: Mon Jun 17 19:01:32 2013 +0300

    Change unique constraint in VirtualInterface.

    UC on column address changed to (address, deleted).
    Used soft_delete instead of delete.
    Migrate scripts updated.
    Fix bug 1156227.

    blueprint db-enforce-unique-keys

    Change-Id: I2f9f92cae3c9e49e0f594437d130c1654f76a343

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: havana-2 → 2013.2
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.