summaryrefslogtreecommitdiffstats
path: root/nova/db
Commit message (Collapse)AuthorAgeFilesLines
* Merge "Session cleanup for db.security_group_* methods"Jenkins2013-07-011-63/+79
|\
| * Session cleanup for db.security_group_* methodsRoman Bogorodskiy2013-06-281-63/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove session parameter from: security_group_get security_group_get_by_name security_group_create security_group_update security_group_ensure_default security_group_count_by_project left as is as it involves quota changes and will be done separately with other _count_by_project functions. Convert security_group_destroy to use model_query() instead of session.query(). blueprint db-session-cleanup Change-Id: I31e8333f67cf900b6f4aa6c5b967a9a6fb71147e
* | Merge "Sync db.models with migrations."Jenkins2013-07-011-21/+32
|\ \
| * | Sync db.models with migrations.Svetlana Shturm2013-07-011-21/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch syncs models with migrations for: - Snapshot - SnapshotIdMapping - TaskLog - VirtualInterface Blueprint: db-sync-models-with-migrations Change-Id: I4f2d5d4ca16f63522d6ebd70661992e4013085f0
* | | Merge "Fix typo for instance_get_all_by_filters() function."Jenkins2013-07-011-1/+1
|\ \ \
| * | | Fix typo for instance_get_all_by_filters() function.Yufang Zhang2013-06-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | One special key to filter instance should be 'soft_deleted' instead of 'soft-deleted'. Change-Id: I73482a3307a18b8eaf8e179b39b44354248619b8
* | | | Merge "Sync db.models and migrations."Jenkins2013-07-011-11/+22
|\ \ \ \
| * | | | Sync db.models and migrations.Svetlana Shturm2013-06-251-11/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch syncs models with migrations for: - DNSDomain - AggregateMetadata - BandwidthUsage Blueprint: db-sync-models-with-migrations Change-Id: I09c48bac5ed780a7ec1b89cc8ce0684f4903d9dd
* | | | | Merge "Fix sqlalchemy utils."Jenkins2013-06-281-3/+13
|\ \ \ \ \
| * | | | | Fix sqlalchemy utils.Yuriy Zveryanskyy2013-06-271-3/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch affects drop_unique_constraint() on sqlite engine. 1. Fix error for tables with foreign key(s). 2. Now work with tables contains reserved words in column names ("key" for example). Fix bug 1195216. Change-Id: Idc4dfa5006eee115f578b00d675cae1d6241ec69
* | | | | | Merge "db.compute_node_update: ignore values['update_at']"Jenkins2013-06-281-2/+1
|\ \ \ \ \ \ | |_|_|_|_|/ |/| | | | |
| * | | | | db.compute_node_update: ignore values['update_at']Peter Feiner2013-06-261-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When individual instances are updated (e.g., during spawn and terminate), ResourceTracker (in nova.compute.resource_tracker) calls compute_node_update with values=self.compute_node. Since self.compute_node is an instance of ComputeNode that was retrieved from the database, it has updated_at set. Since updated_at is in values, sqlalchemy doesn't automatically change the record's updated_at column (see nova.openstack.common.db.sqlalchemy.models.TimestampMixin). Moreover, since updated_at is set to the last value's updated_at, updated_at effectively doesn't change until values without updated_at are sent, which only happens during the periodic task that calls ResourceTracker.update_available_resources. Nova-scheduler relies on ComputeNode.updated_at to keep its model of available resources up-to-date. In particular, nova-scheduler doesn't play a role in instance termination, so it doesn't account for freed resources until ComputeNode.updated_at changes. Thus, between nova-compute's periodic calls to ResourceTracker.update_available_resources, nova-scheduler's model of available resources monotonically decreases. If, for example, a node has resources for 10 instances, and you manage to boot 10, terminate 10, then attempt to boot another before the end of the period, nova-scheduler won't schedule the new instance on the vacant node. Fixes bug #1194900. Note that f398b9e195cda582bad57396b097dec274384c07 fixed a separate issue (bug #1153778) related to ComputeNode.update_at being stale. Change-Id: Ifd1e56edfd811241816970715071876857de80d3
* | | | | | Merge "Sync db.models.Quota* with migrations."Jenkins2013-06-271-8/+15
|\ \ \ \ \ \ | |_|_|_|/ / |/| | | | |
| * | | | | Sync db.models.Quota* with migrations.Svetlana Shturm2013-06-201-8/+15
| | |_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | Blueprint: db-sync-models-with-migrations Change-Id: Ic97690b650151eb7086cbd40093c0f3c373133e2
* | | | | Merge "Retry quota_reserve on DBDeadlock"Jenkins2013-06-261-0/+1
|\ \ \ \ \
| * | | | | Retry quota_reserve on DBDeadlockChris Behrens2013-06-211-0/+1
| | |/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | quota_reserve() can raise DBDeadlock... so this adds the decorator that retries the transaction. Fixes bug 1193199 Change-Id: Id632360372b21f3e75a2af50153eb18cc2025390
* | | | | Merge "Cells: Add support for global cinder"Jenkins2013-06-261-3/+6
|\ \ \ \ \ | |_|_|/ / |/| | | |
| * | | | Cells: Add support for global cinderChris Behrens2013-06-111-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implements cinder support for compute cells when cinder is a global installation. Adds syncing of the block device mapping table between child cells and API cells. Implements blueprint cells-cinder-support Change-Id: Ife5be9922db0742c8ee4f970517396be86597cce
* | | | | Refactor db.security_group_get() instance join behaviorDan Smith2013-06-222-8/+13
| |/ / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, security_group['instances'] is always joined when we do a db.security_group_get(). This patch adds the growingly- conventional columns_to_join argument to the call, allowing us to selectively choose when we want to make this expensive join operation. Related to unified-object-model Change-Id: I1945365c8cf03c027fd143f677cbd6d63a7f8122
* | | | Merge "Remove db session hack from conductor's vol_usage_update()"Jenkins2013-06-202-6/+6
|\ \ \ \ | |_|/ / |/| | |
| * | | Remove db session hack from conductor's vol_usage_update()Dan Smith2013-06-182-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 3cf4cb2534c387f287f118d4185d54b1435d3bc0 made the vol_usage_update() in conductor hack around a stale sqlalchemy object issue by keeping session active in the current context until the notification was completed. This layering violation led to some "creative" tests to try to verify this behavior. This removes that and refreshes the object before letting it out of the db/api layer so that all the attributes are present, thus avoiding the dynamic load during notification. Change-Id: Ia6ef5cb7f462ff72d170f3af33f2d020ee4d3e3c
* | | | Merge "Remove unused cert db method."Jenkins2013-06-181-12/+0
|\ \ \ \ | |/ / / |/| | |
| * | | Remove unused cert db method.Russell Bryant2013-06-141-12/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | nova.db.sqlalchemy.api contained a certificate_get() method that was unused. It was not in the main db.api. This method was also the only reference to CertificateNotFound, so remove that as well. Change-Id: Iba9aece2302e2f175e5d60e48b23959885a81c8d
* | | | Merge "Session cleanup for db.security_group_rule_* methods"Jenkins2013-06-181-27/+23
|\ \ \ \
| * | | | Session cleanup for db.security_group_rule_* methodsYuzlikeev Eduard2013-06-141-27/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Session objects shouldn't be used in public db.api methods because db.api should be independent of db implementation. Remove session parameter from: test_security_group_rule_destroy test_security_group_rule_get test_security_group_rule_get_by_security_group test_security_group_rule_get_by_security_group_grantee blueprint db-session-cleanupRoutine refactor. Change-Id: I36a71547124b655ed89d340fed02315f3b7f1530
* | | | | Merge "Remove trivial cases of unused variables (1)"Jenkins2013-06-182-4/+1
|\ \ \ \ \ | |_|_|_|/ |/| | | |
| * | | | Remove trivial cases of unused variables (1)Stanislaw Pitucha2013-06-132-4/+1
| | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Kill some of the variables marked as unused by flakes8. This should allow to enable F841 check in the future. Only trivial cases with no function calls and obviously pure functions (like datetime.now(), or len()) are cleaned up here. Part 1, split to reduce conflicts. Change-Id: I82854349574ec4bcb9336aba626eefdaed81a8c8
* | | | Add unique constraints to Cell.Yuriy Zveryanskyy2013-06-173-1/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In documentation: "name: Name of the current cell. This must be unique for each cell" Added unique constraint 'uniq_cell_name0deleted' ('name','deleted') to Cell model and migrate sripts. Added new exception `CellsExists`. Updated cell_create() in db.api. Tests updated respectively. blueprint db-enforce-unique-keys Change-Id: Ib76e167089cb4756e4438613b49013ebf0874afe
* | | | Add missing tests for cell_* methodsYuriy Zveryanskyy2013-06-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There was no tests in test_db_api for cell_* methods. Also small fix CellNotFound exception. Add tests to ensure that all works. blueprint db-api-tests Change-Id: I63f3a449238f870fe2549ea5c008b636104e5002
* | | | Merge "Removed session from reservation_create()"Jenkins2013-06-151-1/+8
|\ \ \ \ | |_|/ / |/| | |
| * | | Removed session from reservation_create()Sergey Skripnick2013-05-301-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Removed session objects from public reservation_create() function in nova/db/sqlalchemy/api module. Minor code refactoring. blueprint db-session-cleanup Change-Id: Ib87dd407328b0208a92a7e50bf4117e85fc512fb
* | | | Merge "Fix _drop_unique_constraint_in_sqlite() function."Jenkins2013-06-141-0/+28
|\ \ \ \
| * | | | Fix _drop_unique_constraint_in_sqlite() function.Victor Sergeyev2013-05-291-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We got incorrect unique constrains in function _drop_unique_constraint_in_sqlite(). New function `_get_unique_constraints_in_sqlite()` was added to fix it. Change-Id: Iebb4c0e6c3e6a069ba5cde2fdb2a2ff1200b826f Fixes: bug 1184526
* | | | | Merge "Sending volume IO usage broken"Jenkins2013-06-132-11/+7
|\ \ \ \ \ | |_|_|/ / |/| | | |
| * | | | Sending volume IO usage brokenMichael Kerrin2013-06-072-11/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is my fault, I didn't test the sending of notifications enough when fixing bug 1182102, when the volume IO usage notifications were been sent too often. This was merged as part of https://review.openstack.org/#/c/29915 The issue was that the code worked for the first IO usage event (the one I looked at). Then when constructing the event payload for the second and following IO usage events the code path ended up comparing a datetime object from the db with a cached string representation of the last_refreshed date that was passed into the conductor via the RPC. Since last_refreshed argument to vol_usage_update in the db layer is not needed and is causing these issues. I have removed last_refreshed argument from the db layer and deprecated it from the conduction API. Change-Id: I2030eb7912c56134ea688a6e8bbfcdeddca28307
* | | | | Remove use of locals() in db migrations.Michael Still2013-06-132-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This isn't logging usage, but I still feel that something more explicit is safer. Let's not try to be too clever. Change-Id: I40633283dbdced6d69eb78e22a04eeb6957c0841
* | | | | Merge "Use an inner join on aggregate_hosts in aggregate_get_by_host"Jenkins2013-06-131-3/+10
|\ \ \ \ \
| * | | | | Use an inner join on aggregate_hosts in aggregate_get_by_hostDavid Ripton2013-06-111-3/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes bug 1187708 By default, sqlalchemy.orm.joinedload does a left outer join. But in aggregate_get_by_host, we only want to get aggregates rows with aggregate_hosts rows that match the host, and a left outer join also gave us aggregates rows with no matching aggregate_hosts row. Also improve test_aggregate_get_by_host to catch this bug. Change-Id: Ida9647af02ab58229abe3c50dc3d2c7ec9792a5e
* | | | | | Merge "Improve the performance of migration 186"Jenkins2013-06-131-68/+79
|\ \ \ \ \ \
| * | | | | | Improve the performance of migration 186Nikola Dipanov2013-06-121-68/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch significantly improves the performance of migration 186 by refactoring the migration code to use SQL joins. It does in no way functionally change what the migration does. It also adds a more robust test to make sure that there were no regressions. Change-Id: I654ed8dd229d774e8f680cae2b8d2ad2cf28550c
* | | | | | | Merge "Fix and enable H403 tests"Jenkins2013-06-134-12/+27
|\ \ \ \ \ \ \
| * | | | | | | Fix and enable H403 testsDirk Mueller2013-06-124-12/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Multi-line doc-strings should end on a new, separate line. Change-Id: I4cf0cfe92b634ef77971863a4df41ef43531bc20
* | | | | | | | Merge "Add missing exception to cell_update()"Jenkins2013-06-121-0/+2
|\ \ \ \ \ \ \ \
| * | | | | | | | Add missing exception to cell_update()Yuriy Zveryanskyy2013-06-061-0/+2
| | |_|_|/ / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add missing CellNotFound exception to cell_update() in db.sqlalchemy.api, which expected from this method. Change-Id: I25699a08b581922b13ae62708486bdee6f8b0ac6
* | | | | | | | Merge "Fix a race where a soft deleted instance might be removed by mistake"Jenkins2013-06-121-1/+1
|\ \ \ \ \ \ \ \ | |_|/ / / / / / |/| | | | | | |
| * | | | | | | Fix a race where a soft deleted instance might be removed by mistakeHans Lindgren2013-06-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a soft deleted instance is restored there is a tiny risk that it might be deleted if the reclaim periodic task runs at the same time. This happens because the restore operation sets deleted_at to None which makes the reclaim job think it is ok to delete the instance. This can be resolved by restricting reclaims to only those instances whose task_state is None. Resolves bug 1186243. Change-Id: Ia138e2d504b7482c46900583f019a32c70513245
* | | | | | | | Merge "Add missing tests for nova.db.api.network_*."Jenkins2013-06-122-17/+0
|\ \ \ \ \ \ \ \
| * | | | | | | | Add missing tests for nova.db.api.network_*.Sergey Skripnick2013-06-122-17/+0
| | |_|/ / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added new tests for nova.db.api.network_*. Moved existent tests for nova.db.api.network_* into NetworkTestCase. Removed unused and invalid method network_get_all_by_instance(). blueprint test-db-api Change-Id: Ib06135138d846f50f1aad1277afadf7639522226
* | | | | | | | Merge "Give a way to save why a service has been disabled."Jenkins2013-06-122-0/+37
|\ \ \ \ \ \ \ \
| * | | | | | | | Give a way to save why a service has been disabled.Andrea Rosa2013-06-122-0/+37
| |/ / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implements blueprint record-reason-for-disabling-service We added a field to the service table to log a reason when a service has been disabled. We added a new API extension called os-extended-services. The new extension will extend the os-services extension adding: - A method for disabling a service and specify a reason for that. PUT /v2/{tenant_id}/os-services/disable-log-reason When the os-extended-extension is loaded the call: GET /V2/{tenant_id}/os-services will return the list of services with reason information it that exists. DocImpact Change-Id: I87a4affc45160796ff11c7b03e591e6aba73d62a