Complete db unique key enforcement on all tables dbs
* Add real unique indexes on (`col`, `deleted`), and when deleting any row, set `deleted`=`id` instead of `deleted`=1.
* Handle duplicate key errors in a sane way.
* In db/sqlalchemy/
* Add to models missing unique constraints (just to show what UC model have)
Blueprint information
- Status:
- Complete
- Approver:
- Sean Dague
- Priority:
- High
- Drafter:
- None
- Direction:
- Needs approval
- Assignee:
- Boris Pavlovic
- Definition:
- Approved
- Series goal:
- Accepted for havana
- Implementation:
-
Implemented
- Milestone target:
-
2013.2
- Started by
- Boris Pavlovic
- Completed by
- Boris Pavlovic
Whiteboard
⬥ Tables that should have UC:
✓ task_log:
UC on ('task_name', 'host', 'period_beginning', 'period_ending')
✓ networks:
UC on ('vlan', 'deleted')
✓ floating_ips:
UC on (address, deleted)
✓ instance_types:
UC on (name, deleted) and (flavorid, deleted)
✓ instance_
UC on (project_id, instance_type_id, deleted)
✓ instance_
UC on (instance_type_id, key, deleted)
✓ virtual_interfaces:
At this moment this method has UC on column address, we should change it to (address, deleted)
and use soft_deleted instead of delete.
✓ services:
UC on columns (host, topic, deleted), (host, binary, deleted).
✓ security_groups:
UC on columns (project_id, name, deleted)
✓ fixed_ips:
UC on (address, deleted)
✓ cells:
UC on (name, deleted)
✓ quotas:
UC on (project_id, resource, deleted)
✓ aggregate_hosts:
UC on (host, aggregate_id, deleted)
⚒ aggregate_metadata:
UC on (aggregate_id, key, deleted)
✓ agent_builds:
UC on (hypervisor, os, architecture, deleted)
----
Addressed by: https:/
Remove race condition (in Networks)
Addressed by: https:/
Remove race condition (in TaskLog)
Addressed by: https:/
Remove race condition (in InstanceTypes)
Addressed by: https:/
Remove race condition (in FloatingIps)
Gerrit topic: https:/
Addressed by: https:/
Add missing tests for db.instance_type_* methods
Addressed by: https:/
Add missing tests for db.instance_
Addressed by: https:/
Remove race condition (in InstanceTypePro
Gerrit topic: https:/
Gerrit topic: https:/
Addressed by: https:/
Refactored tests for key_pair_*() functions.
Addressed by: https:/
Add missing unique constraint to KeyPair model.
Addressed by: https:/
Add unique constraints to FixedIp and FloatingIp.
Gerrit topic: https:/
Addressed by: https:/
Rename unique constraints due to new convention.
Gerrit topic: https:/
Addressed by: https:/
Add unique contraints for security groups
Addressed by: https:/
Session cleanup for db.security_group_* methods
Addressed by: https:/
Add unique constraints to Cell.
Addressed by: https:/
Add unique constraints to Quota.
Addressed by: https:/
Change unique constraint in VirtualInterface.
Addressed by: https:/
Add unique constraints to Service.
Addressed by: https:/
Minor cleanup of tests/db/
Gerrit topic: https:/
Addressed by: https:/
Enforce block device mapping reservations within the database.
Gerrit topic: https:/
Gerrit topic: https:/
Gerrit topic: https:/
Addressed by: https:/
Add unique constraints to InstanceTypeExt
Gerrit topic: https:/
Addressed by: https:/
Add unique constraints to AggregateHost.
Gerrit topic: https:/
Addressed by: https:/
Add unique constraint to AgentBuild.
Gerrit topic: https:/
Gerrit topic: https:/
Gerrit topic: https:/
Gerrit topic: https:/
Gerrit topic: https:/
Addressed by: https:/
Add unique constraint to ConsolePool.
Gerrit topic: https:/
Gerrit topic: https:/
Gerrit topic: https:/
Addressed by: https:/
Add unique constraint to AggregateMetadata.
Work Items
Dependency tree

* Blueprints in grey have been implemented.