| Commit message (Collapse) | Author | Age | Files | Lines |
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
|\ \ |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This patch syncs models with migrations for:
- Snapshot
- SnapshotIdMapping
- TaskLog
- VirtualInterface
Blueprint: db-sync-models-with-migrations
Change-Id: I4f2d5d4ca16f63522d6ebd70661992e4013085f0
|
|\ \ \ |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
One special key to filter instance should be 'soft_deleted' instead
of 'soft-deleted'.
Change-Id: I73482a3307a18b8eaf8e179b39b44354248619b8
|
|\ \ \ \ |
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
This patch syncs models with migrations for:
- DNSDomain
- AggregateMetadata
- BandwidthUsage
Blueprint: db-sync-models-with-migrations
Change-Id: I09c48bac5ed780a7ec1b89cc8ce0684f4903d9dd
|
|\ \ \ \ \ |
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
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
|
|\ \ \ \ \ \
| |_|_|_|_|/
|/| | | | | |
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
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
|
|\ \ \ \ \ \
| |_|_|_|/ /
|/| | | | | |
|
| | |_|_|/
| |/| | |
| | | | |
| | | | |
| | | | |
| | | | | |
Blueprint: db-sync-models-with-migrations
Change-Id: Ic97690b650151eb7086cbd40093c0f3c373133e2
|
|\ \ \ \ \ |
|
| | |/ / /
| |/| | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
quota_reserve() can raise DBDeadlock... so this adds the decorator that
retries the transaction.
Fixes bug 1193199
Change-Id: Id632360372b21f3e75a2af50153eb18cc2025390
|
|\ \ \ \ \
| |_|_|/ /
|/| | | | |
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
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
|
| |/ / /
|/| | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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
|
|\ \ \ \
| |_|/ /
|/| | | |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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
|
|\ \ \ \
| |/ / /
|/| | | |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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
|
|\ \ \ \ |
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
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
|
|\ \ \ \ \
| |_|_|_|/
|/| | | | |
|
| | |/ /
| |/| |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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
|
|\ \ \ \
| |_|/ /
|/| | | |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Removed session objects from public reservation_create() function
in nova/db/sqlalchemy/api module. Minor code refactoring.
blueprint db-session-cleanup
Change-Id: Ib87dd407328b0208a92a7e50bf4117e85fc512fb
|
|\ \ \ \ |
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
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
|
|\ \ \ \ \
| |_|_|/ /
|/| | | | |
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
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
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
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
|
|\ \ \ \ \ |
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
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
|
|\ \ \ \ \ \ |
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
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
|
|\ \ \ \ \ \ \ |
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
Multi-line doc-strings should end on a new, separate line.
Change-Id: I4cf0cfe92b634ef77971863a4df41ef43531bc20
|
|\ \ \ \ \ \ \ \ |
|
| | |_|_|/ / / /
| |/| | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
Add missing CellNotFound exception to
cell_update() in db.sqlalchemy.api,
which expected from this method.
Change-Id: I25699a08b581922b13ae62708486bdee6f8b0ac6
|
|\ \ \ \ \ \ \ \
| |_|/ / / / / /
|/| | | | | | | |
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
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
|
|\ \ \ \ \ \ \ \ |
|
| | |_|/ / / / /
| |/| | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
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
|
|\ \ \ \ \ \ \ \ |
|
| |/ / / / / / /
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
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
|