Improve session handling in nova/db/api
Bring the use of sessions and transactions in nova/db/
* use explicit transactions only when necessary
* don't pass session objects to public methods
An easy way to find methods which need to be updated is:
grep -P 'def [^_].*session=' nova/db/
Also, annotate methods that pose a risk but can not be easily addressed right now. Current known risks are:
- with_lockmode may deadlock (or at least create a global bottleneck)
- duplicate-insert race conditions (due to lack of UNIQUE constraints)
Blueprint information
- Status:
- Complete
- Approver:
- Russell Bryant
- Priority:
- High
- Drafter:
- aeva black
- Direction:
- Approved
- Assignee:
- Boris Pavlovic
- Definition:
- Approved
- Series goal:
- Accepted for havana
- Implementation:
- Implemented
- Milestone target:
- 2013.2
- Started by
- aeva black
- Completed by
- Boris Pavlovic
Related branches
Related bugs
Sprints
Whiteboard
Gerrit topic: https:/
Addressed by: https:/
clean up dnsdomain_
Addressed by: https:/
improve session handling of dnsdomain_list
Addressed by: https:/
add missing import to test_db_api.py
Addressed by: https:/
improve session handling around quotas
Addressed by: https:/
improve sessions for reservation and snapshots
Addressed by: https:/
improve sessions for reservation
Addressed by: https:/
improve session handling around virtual_interfaces
Addressed by: https:/
improve session handling around instance_ methods
Addressed by: https:/
improve sessions for key_pair_
Addressed by: https:/
remove session param from certificate_get
Addressed by: https:/
remove session param from instance_
Addressed by: https:/
remove session param from instance_get
Addressed by: https:/
Add soft_delete() method in sqlalchemy.
Addressed by: https:/
Using query.soft_delete() method insead of soft deleting by hand
Addressed by: https:/
Database reservations methods performance optimization
Addressed by: https:/
db.
Addressed by: https:/
db.
Addressed by: https:/
Database metadata performance optimizations
Addressed by: https:/
Fix bug in db.instance_
Addressed by: https:/
Remove session.flush() and session.query() monkey patching
Addressed by: https:/
NovaBase.
Addressed by: https:/
Refactor work with TaskLog in sqlalchemy.api
Addressed by: https:/
Remove restoring soft deleted entries
Gerrit topic: https:/
Addressed by: https:/
Remove restoring soft deleted entries part 2
Addressed by: https:/
Add mising tests for db.block_
Addressed by: https:/
Refactor work with session in db.block_
Gerrit topic: https:/
Addressed by: https:/
Refactor db.service_destroy and db.service_update methods
Addressed by: https:/
Add missing tests for instance_
Addressed by: https:/
Refactor work with db.instance_type_* methods
Addressed by: https:/
Remove race condition (in InstanceTypePro
Gerrit topic: https:/
Addressed by: https:/
Session cleanup for db.floating_ip_* methods
Gerrit topic: https:/
Addressed by: https:/
Removed session from fixed_ip_*() functions.
Addressed by: https:/
Removed session from reservation_
Gerrit topic: https:/
Addressed by: https:/
Add tests for nova.db.
Addressed by: https:/
Session cleanup for db.security_group_* methods
Addressed by: https:/
Session cleanup for db.security_
Addressed by: https:/
Move resource usage sync functions to db backend
Gerrit topic: https:/
Gerrit topic: https:/
Addressed by: https:/
Add missing tests for db.api.instance_* methods
Gerrit topic: https:/
Addressed by: https:/
Clean up db.sqla.
Addressed by: https:/
Clean up session in db.api.sqla.get_ec2 methods
Addressed by: https:/
Clean up Session in db.sqla.api.network and sec_groups methods
Addressed by: https:/
Clean up session in db.sqla.
Addressed by: https:/
Finish DB session clenup
Gerrit topic: https:/
Work Items
Dependency tree
* Blueprints in grey have been implemented.