summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--releasenotes/notes/cassandra-backup-and-restore-00de234de67ea5ee.yaml4
-rw-r--r--releasenotes/notes/cassandra-configuration-groups-e6bcf4014a79f14f.yaml5
-rw-r--r--releasenotes/notes/cassandra-user-functions-041abfa4f4baa591.yaml89
-rw-r--r--releasenotes/notes/couchdb-backup-restore-0cc3324c3088f947.yaml3
-rw-r--r--releasenotes/notes/couchdb-user-db-functions-fa41ac47fce095cb.yaml3
-rw-r--r--releasenotes/notes/db2-backup-restore-96ab214cddd15181.yaml3
-rw-r--r--releasenotes/notes/dbaas-ceilometer-notifications-5a623d0d6520be72.yaml5
-rw-r--r--releasenotes/notes/drop-python-26-support-39dff0c5636edc74.yaml3
-rw-r--r--releasenotes/notes/fix-apply-configuration-on-prepare-4cff827b7f3c4d33.yaml10
-rw-r--r--releasenotes/notes/fix-bad-swift-endpoint-in-guestlog-05f7483509dacbbf.yaml6
-rw-r--r--releasenotes/notes/fix-mongo-cluster-grow-8fa4788af0ce5309.yaml5
-rw-r--r--releasenotes/notes/fix-trove-events-8ce54233504065cf.yaml3
-rw-r--r--releasenotes/notes/implement-cassandra-clustering-9f7bc3ae6817c19e.yaml5
-rw-r--r--releasenotes/notes/implement-cassandra-root-b0870d23dbf1a848.yaml4
-rw-r--r--releasenotes/notes/implement-mariadb-clustering-088ac2f6012689fb.yaml5
-rw-r--r--releasenotes/notes/improve-mysql-user-list-pagination-71457d934500f817.yaml4
-rw-r--r--releasenotes/notes/mariadb-gtid-replication-1ea972bcfe909773.yaml8
-rw-r--r--releasenotes/notes/module-management-66d3979cc45ed440.yaml8
-rw-r--r--releasenotes/notes/mongo-cluster-grow-use-az-and-nic-values-207b041113e7b4fb.yaml5
-rw-r--r--releasenotes/notes/mysql-user-list-pagination-9496c401c180f605.yaml5
-rw-r--r--releasenotes/notes/percona-2.3-support-2eab8f12167e44bc.yaml8
-rw-r--r--releasenotes/notes/pxc-cluster-root-enable-30c366e3b5bcda51.yaml3
-rw-r--r--releasenotes/notes/pxc-grow-shrink-0b1ee689cbc77743.yaml14
-rw-r--r--releasenotes/notes/secure-mongodb-instances-1e6d7df3febab8f4.yaml6
-rw-r--r--releasenotes/notes/use-osprofiler-options-58263c311617b127.yaml4
-rw-r--r--releasenotes/notes/vertica-configuration-groups-710c892c1e3d6a90.yaml3
-rw-r--r--releasenotes/notes/vertica-grow-shrink-cluster-e32d48f5b2e1bfab.yaml3
-rw-r--r--releasenotes/notes/vertica-load-via-curl-call-4d47c4e0b1b53471.yaml8
-rw-r--r--trove/common/exception.py5
-rw-r--r--trove/common/strategies/cluster/experimental/mongodb/api.py18
-rw-r--r--trove/common/strategies/cluster/experimental/redis/api.py20
-rw-r--r--trove/common/strategies/cluster/experimental/vertica/api.py14
-rw-r--r--trove/guestagent/strategies/restore/mysql_impl.py11
-rw-r--r--trove/tests/unittests/guestagent/test_backups.py18
34 files changed, 288 insertions, 30 deletions
diff --git a/releasenotes/notes/cassandra-backup-and-restore-00de234de67ea5ee.yaml b/releasenotes/notes/cassandra-backup-and-restore-00de234de67ea5ee.yaml
new file mode 100644
index 00000000..65a9b1b7
--- /dev/null
+++ b/releasenotes/notes/cassandra-backup-and-restore-00de234de67ea5ee.yaml
@@ -0,0 +1,4 @@
+---
+features:
+ - Support has been added for Cassandra backup and resture using the
+ Nodetool utility.
diff --git a/releasenotes/notes/cassandra-configuration-groups-e6bcf4014a79f14f.yaml b/releasenotes/notes/cassandra-configuration-groups-e6bcf4014a79f14f.yaml
new file mode 100644
index 00000000..1e99d8e4
--- /dev/null
+++ b/releasenotes/notes/cassandra-configuration-groups-e6bcf4014a79f14f.yaml
@@ -0,0 +1,5 @@
+---
+features:
+ - Implement configuration groups for Cassandra 2.1.
+ You can now manage configuration of Cassandra datastores
+ using the Trove configuration groups capability.
diff --git a/releasenotes/notes/cassandra-user-functions-041abfa4f4baa591.yaml b/releasenotes/notes/cassandra-user-functions-041abfa4f4baa591.yaml
new file mode 100644
index 00000000..79ea8a50
--- /dev/null
+++ b/releasenotes/notes/cassandra-user-functions-041abfa4f4baa591.yaml
@@ -0,0 +1,89 @@
+---
+features:
+ - This patch set implements the following functionality for Cassandra
+ datastore.
+
+ create/delete/get user
+ list users
+ change password
+ grant/revoke/list access
+ update attributes
+
+ create/delete database
+ list databases
+
+ Notes on Cassandra users
+
+ In Cassandra only SUPERUSERS can create other users and
+ grant permissions to database resources.
+ Trove uses the 'os_admin' superuser to perform its administrative
+ tasks. It proactively removes the built-in 'cassandra' superuser
+ on prepare.
+ The users it creates are all 'normal' (NOSUPERUSER) accounts.
+ The permissions it can grant are also limited to non-superuser
+ operations. This is to prevent anybody from creating a new superuser via
+ the Trove API.
+ Updatable attributes include username and password.
+
+ The configuration template had to be updated to enable authentication
+ and authorization support (original configuration allowed anonymous
+ connections). Default implementations used are
+ authenticator org.apache.cassandra.auth.PasswordAuthenticator
+ authorizer org.apache.cassandra.auth.CassandraAuthorizer
+
+ The superuser password is set to a random Trove password which is then
+ stored in a Trove-read-only file in '~/.cassandra/cqlshrc' which is
+ also the default location for client settings.
+
+ Notes on Cassandra keyspaces
+
+ Cassandra stores replicas on multiple nodes to ensure reliability and
+ fault tolerance. All replicas are equally important;
+ there is no primary or master.
+ A replication strategy determines the nodes where
+ replicas are placed.
+ The total number of replicas across the cluster is referred to as the
+ replication factor.
+ The above 'create database' implementation uses 'SimpleStrategy'
+ with just a single replica on the guest machine.
+ This is a very simplistic configuration only good for the most basic
+ applications and demonstration purposes. SimpleStrategy is for a single
+ data center only.
+ The following system keyspaces have been included in the default
+ 'ignore_dbs' configuration list and therefore excluded from all database
+ operations 'system', 'system_auth', 'system_traces'
+
+ Notes on user rename
+
+ Cassandra does not have a native way for renaming users.
+ The reason why Cassandra itself does not implement rename is apparently just
+ lack of demand for that feature.
+ We implement it by creating a new user, transferring permissions and
+ dropping the old one (which also removes its existing permissions).
+ I asked about the sanity of this rename approach on the Cassandra mailing
+ list and IRC channel and there should not be anything inherently wrong
+ with the proposed procedure.
+ This method, however, requires the user to always provide a password.
+
+ Additional notes
+
+ Trove uses the official open-source Python driver for Cassandra
+ to connect to the database and execute queries.
+ The connection is implemented in CassandraConnection. It is now also
+ used to obtain the current database status as opposed to the original
+ method of parsing output of the client tool.
+
+ The 'common/operating_system' module was extended with two new functions
+ for reading/writing ini-style and YAML configuration files to/from Python
+ dicts. Unit tests were added to 'guestagent/test_operating_system'.
+
+ The existing Manager unit tests were extended to include the added
+ functionality.
+
+ Also includes some minor improvements to comments and log messages.
+ Used the existing operating_system interface to update file
+ ownership.
+
+ The system module was removed and its contents moved to the Application
+ class. This is to reduce the number of files and help facilitate
+ overriding.
diff --git a/releasenotes/notes/couchdb-backup-restore-0cc3324c3088f947.yaml b/releasenotes/notes/couchdb-backup-restore-0cc3324c3088f947.yaml
new file mode 100644
index 00000000..dcf014fa
--- /dev/null
+++ b/releasenotes/notes/couchdb-backup-restore-0cc3324c3088f947.yaml
@@ -0,0 +1,3 @@
+---
+features:
+ - Support has been added for CouchDB Backup and Restore.
diff --git a/releasenotes/notes/couchdb-user-db-functions-fa41ac47fce095cb.yaml b/releasenotes/notes/couchdb-user-db-functions-fa41ac47fce095cb.yaml
new file mode 100644
index 00000000..f6f7e2a2
--- /dev/null
+++ b/releasenotes/notes/couchdb-user-db-functions-fa41ac47fce095cb.yaml
@@ -0,0 +1,3 @@
+---
+features:
+ - Support has been added for CouchDB database and user functions.
diff --git a/releasenotes/notes/db2-backup-restore-96ab214cddd15181.yaml b/releasenotes/notes/db2-backup-restore-96ab214cddd15181.yaml
new file mode 100644
index 00000000..fe3526d6
--- /dev/null
+++ b/releasenotes/notes/db2-backup-restore-96ab214cddd15181.yaml
@@ -0,0 +1,3 @@
+---
+features:
+ - Support has been added for DB2 Express-C Backup and Restore.
diff --git a/releasenotes/notes/dbaas-ceilometer-notifications-5a623d0d6520be72.yaml b/releasenotes/notes/dbaas-ceilometer-notifications-5a623d0d6520be72.yaml
new file mode 100644
index 00000000..d900d623
--- /dev/null
+++ b/releasenotes/notes/dbaas-ceilometer-notifications-5a623d0d6520be72.yaml
@@ -0,0 +1,5 @@
+---
+features:
+ - Additional Ceilometer notifications have been provided by
+ Trove including create, end, error notifications for all
+ state-changing API calls.
diff --git a/releasenotes/notes/drop-python-26-support-39dff0c5636edc74.yaml b/releasenotes/notes/drop-python-26-support-39dff0c5636edc74.yaml
new file mode 100644
index 00000000..4ef3077b
--- /dev/null
+++ b/releasenotes/notes/drop-python-26-support-39dff0c5636edc74.yaml
@@ -0,0 +1,3 @@
+---
+deprecations:
+ - Dropping support for python 2.6
diff --git a/releasenotes/notes/fix-apply-configuration-on-prepare-4cff827b7f3c4d33.yaml b/releasenotes/notes/fix-apply-configuration-on-prepare-4cff827b7f3c4d33.yaml
new file mode 100644
index 00000000..e327be83
--- /dev/null
+++ b/releasenotes/notes/fix-apply-configuration-on-prepare-4cff827b7f3c4d33.yaml
@@ -0,0 +1,10 @@
+---
+fixes:
+ - If given, apply the configuration overrides in prepare,
+ just before creating initial users and/or databases.
+ Failure to apply the given configuration should flip the
+ instance into a failed state.
+ Default implementation saves the overrides and
+ restarts the database service to apply the changes.
+ Datastores that do not require restart may potentially override
+ the base implementation in 'apply_overrides_on_prepare()'.
diff --git a/releasenotes/notes/fix-bad-swift-endpoint-in-guestlog-05f7483509dacbbf.yaml b/releasenotes/notes/fix-bad-swift-endpoint-in-guestlog-05f7483509dacbbf.yaml
new file mode 100644
index 00000000..a9da0624
--- /dev/null
+++ b/releasenotes/notes/fix-bad-swift-endpoint-in-guestlog-05f7483509dacbbf.yaml
@@ -0,0 +1,6 @@
+---
+fixes:
+ - The guest log code raises a non-serializable exception if the given
+ Swift endpoint is invalid. This causes an ambiguous "Circular
+ reference detected" error on the guest, and a timeout on the caller.
+ This case is now caught and the correct exception raised.
diff --git a/releasenotes/notes/fix-mongo-cluster-grow-8fa4788af0ce5309.yaml b/releasenotes/notes/fix-mongo-cluster-grow-8fa4788af0ce5309.yaml
new file mode 100644
index 00000000..025a12f4
--- /dev/null
+++ b/releasenotes/notes/fix-mongo-cluster-grow-8fa4788af0ce5309.yaml
@@ -0,0 +1,5 @@
+---
+fixes:
+ - Fixes bug 1526024, a failure in growing a mongodb cluster because
+ of a problem in the way in which passwords were synchronized with
+ new query routers.
diff --git a/releasenotes/notes/fix-trove-events-8ce54233504065cf.yaml b/releasenotes/notes/fix-trove-events-8ce54233504065cf.yaml
new file mode 100644
index 00000000..2a4b1324
--- /dev/null
+++ b/releasenotes/notes/fix-trove-events-8ce54233504065cf.yaml
@@ -0,0 +1,3 @@
+---
+fixes:
+ - Generate trove events for the current period, and not a future period.
diff --git a/releasenotes/notes/implement-cassandra-clustering-9f7bc3ae6817c19e.yaml b/releasenotes/notes/implement-cassandra-clustering-9f7bc3ae6817c19e.yaml
new file mode 100644
index 00000000..00107524
--- /dev/null
+++ b/releasenotes/notes/implement-cassandra-clustering-9f7bc3ae6817c19e.yaml
@@ -0,0 +1,5 @@
+---
+features:
+ - OpenStack Trove now supports clustering for Cassandra
+ datastores. You can access clustering capabilities through
+ the Trove cluster API.
diff --git a/releasenotes/notes/implement-cassandra-root-b0870d23dbf1a848.yaml b/releasenotes/notes/implement-cassandra-root-b0870d23dbf1a848.yaml
new file mode 100644
index 00000000..28649f66
--- /dev/null
+++ b/releasenotes/notes/implement-cassandra-root-b0870d23dbf1a848.yaml
@@ -0,0 +1,4 @@
+---
+features:
+ - OpenStack Trove now supports superuser access for the Cassandra
+ datastore via the root-enable and root-disable API's.
diff --git a/releasenotes/notes/implement-mariadb-clustering-088ac2f6012689fb.yaml b/releasenotes/notes/implement-mariadb-clustering-088ac2f6012689fb.yaml
new file mode 100644
index 00000000..2e6b2410
--- /dev/null
+++ b/releasenotes/notes/implement-mariadb-clustering-088ac2f6012689fb.yaml
@@ -0,0 +1,5 @@
+---
+features:
+ - OpenStack Trove now supports clustering for MariaDB
+ datastores. You can access clustering capabilities through
+ the Trove cluster API.
diff --git a/releasenotes/notes/improve-mysql-user-list-pagination-71457d934500f817.yaml b/releasenotes/notes/improve-mysql-user-list-pagination-71457d934500f817.yaml
new file mode 100644
index 00000000..7f4068f5
--- /dev/null
+++ b/releasenotes/notes/improve-mysql-user-list-pagination-71457d934500f817.yaml
@@ -0,0 +1,4 @@
+---
+fixes:
+ - Filter ignored users in the original query before
+ the result gets paginated (like in list_databases).
diff --git a/releasenotes/notes/mariadb-gtid-replication-1ea972bcfe909773.yaml b/releasenotes/notes/mariadb-gtid-replication-1ea972bcfe909773.yaml
new file mode 100644
index 00000000..6a949fda
--- /dev/null
+++ b/releasenotes/notes/mariadb-gtid-replication-1ea972bcfe909773.yaml
@@ -0,0 +1,8 @@
+---
+features:
+ - Implements replication based on GTIDs for MariaDB.
+ Adds GTID replication strategy for MariaDB.
+ Implements MariaDB specific GTID handling in guestagent.
+ Configures MariaDB config template to support bin logging.
+ Adds MariaDB helper overrides to eliminate configuration
+ group tests from scenario tests.
diff --git a/releasenotes/notes/module-management-66d3979cc45ed440.yaml b/releasenotes/notes/module-management-66d3979cc45ed440.yaml
new file mode 100644
index 00000000..0d5113a2
--- /dev/null
+++ b/releasenotes/notes/module-management-66d3979cc45ed440.yaml
@@ -0,0 +1,8 @@
+---
+features:
+ - A new feature called 'module management' has been added to Trove.
+ Users can now create, update, list and delete modules. A module is
+ a file that is provided to Trove, and when a database instance is
+ launched, that file is deposited on the guest instance. This feature
+ can be used for depositing files like, for example, license files
+ onto guest database instances.
diff --git a/releasenotes/notes/mongo-cluster-grow-use-az-and-nic-values-207b041113e7b4fb.yaml b/releasenotes/notes/mongo-cluster-grow-use-az-and-nic-values-207b041113e7b4fb.yaml
new file mode 100644
index 00000000..3d7b8b5c
--- /dev/null
+++ b/releasenotes/notes/mongo-cluster-grow-use-az-and-nic-values-207b041113e7b4fb.yaml
@@ -0,0 +1,5 @@
+---
+fixes:
+ - Mongo cluster grow operations were not creating instances with the
+ provided az and nic values. These should be used if the caller provided
+ them.
diff --git a/releasenotes/notes/mysql-user-list-pagination-9496c401c180f605.yaml b/releasenotes/notes/mysql-user-list-pagination-9496c401c180f605.yaml
new file mode 100644
index 00000000..fc38f42b
--- /dev/null
+++ b/releasenotes/notes/mysql-user-list-pagination-9496c401c180f605.yaml
@@ -0,0 +1,5 @@
+---
+fixes:
+ - Fix bug 1537986 which corrects the pagination in the mysql user
+ list command. When internal users (ignore_users) are eliminated
+ from the list, the pagination was not correctly handled.
diff --git a/releasenotes/notes/percona-2.3-support-2eab8f12167e44bc.yaml b/releasenotes/notes/percona-2.3-support-2eab8f12167e44bc.yaml
new file mode 100644
index 00000000..24cbe4b2
--- /dev/null
+++ b/releasenotes/notes/percona-2.3-support-2eab8f12167e44bc.yaml
@@ -0,0 +1,8 @@
+---
+features:
+ - Support has been added for Percona XtraBackup version 2.3.
+fixes:
+ - Fixes bug 1558794. The 2.3 version of Percona XtraBackup performs
+ some additional validations of the command line options passed to
+ innobackupex. The Trove code now complies with the new validations
+ being performed.
diff --git a/releasenotes/notes/pxc-cluster-root-enable-30c366e3b5bcda51.yaml b/releasenotes/notes/pxc-cluster-root-enable-30c366e3b5bcda51.yaml
new file mode 100644
index 00000000..ac76a012
--- /dev/null
+++ b/releasenotes/notes/pxc-cluster-root-enable-30c366e3b5bcda51.yaml
@@ -0,0 +1,3 @@
+---
+features:
+ - Adding the ability to root enable a pxc cluster.
diff --git a/releasenotes/notes/pxc-grow-shrink-0b1ee689cbc77743.yaml b/releasenotes/notes/pxc-grow-shrink-0b1ee689cbc77743.yaml
new file mode 100644
index 00000000..6c4328fe
--- /dev/null
+++ b/releasenotes/notes/pxc-grow-shrink-0b1ee689cbc77743.yaml
@@ -0,0 +1,14 @@
+---
+features:
+ - The adds support for pxc to grow a cluster.
+ * api and taskmanager support for shrinking a cluster
+ * validate that the networks given are the same for each instance in
+ the cluster.
+ * make sure to add the existing networks on an instance in the
+ cluster.
+ * add new Error task for grow and shrink.
+ * nova client version configuration changed to a string option rather
+ than an int option because the nova microversions change nova api
+ output. This was needed for the network interfaces on existing
+ instances.
+ * testing for grow and shrink cluster
diff --git a/releasenotes/notes/secure-mongodb-instances-1e6d7df3febab8f4.yaml b/releasenotes/notes/secure-mongodb-instances-1e6d7df3febab8f4.yaml
new file mode 100644
index 00000000..e9df367e
--- /dev/null
+++ b/releasenotes/notes/secure-mongodb-instances-1e6d7df3febab8f4.yaml
@@ -0,0 +1,6 @@
+---
+security:
+ - Fixes bug 1507841, provides a configuration setting to enable Role
+ Based Access Control (RBAC) for MongoDB clusters. If
+ mongodb.cluster_secure is set to False (default is True) then RBAC
+ will be disabled.
diff --git a/releasenotes/notes/use-osprofiler-options-58263c311617b127.yaml b/releasenotes/notes/use-osprofiler-options-58263c311617b127.yaml
new file mode 100644
index 00000000..655e721d
--- /dev/null
+++ b/releasenotes/notes/use-osprofiler-options-58263c311617b127.yaml
@@ -0,0 +1,4 @@
+---
+other:
+ - Starting with 1.0.0 osprofiler release config options needed for
+ its workability are consolidated inside osprofiler itself.
diff --git a/releasenotes/notes/vertica-configuration-groups-710c892c1e3d6a90.yaml b/releasenotes/notes/vertica-configuration-groups-710c892c1e3d6a90.yaml
new file mode 100644
index 00000000..27bcb577
--- /dev/null
+++ b/releasenotes/notes/vertica-configuration-groups-710c892c1e3d6a90.yaml
@@ -0,0 +1,3 @@
+---
+features:
+ - Implemented configuration groups capability for Vertica datastores.
diff --git a/releasenotes/notes/vertica-grow-shrink-cluster-e32d48f5b2e1bfab.yaml b/releasenotes/notes/vertica-grow-shrink-cluster-e32d48f5b2e1bfab.yaml
new file mode 100644
index 00000000..22744569
--- /dev/null
+++ b/releasenotes/notes/vertica-grow-shrink-cluster-e32d48f5b2e1bfab.yaml
@@ -0,0 +1,3 @@
+---
+features:
+ - Implemented grow and shrink for clusters of Vertica datastore. The number of nodes in the cluster must be greater than the number required to satisfy the min_ksafety configuration setting.
diff --git a/releasenotes/notes/vertica-load-via-curl-call-4d47c4e0b1b53471.yaml b/releasenotes/notes/vertica-load-via-curl-call-4d47c4e0b1b53471.yaml
new file mode 100644
index 00000000..0f757c64
--- /dev/null
+++ b/releasenotes/notes/vertica-load-via-curl-call-4d47c4e0b1b53471.yaml
@@ -0,0 +1,8 @@
+---
+features:
+ - Vertica comes with a User Defined Load function that takes a URL as a
+ load source. This can be used to load files that are stored in Swift. As
+ this is a common use case, it is valuable to enable this by default.
+ This can be done in the post-prepare method for Vertica. A new UDL_LIBS
+ list has been added that describes any UDLs to be loaded into the
+ database. This change only has one entry - the curl function.
diff --git a/trove/common/exception.py b/trove/common/exception.py
index c5f61082..8b624552 100644
--- a/trove/common/exception.py
+++ b/trove/common/exception.py
@@ -568,6 +568,11 @@ class ClusterShrinkMustNotLeaveClusterEmpty(TroveError):
"shrinking.")
+class ClusterShrinkInstanceInUse(TroveError):
+ message = _("Instance(s) %(id)s currently in use and cannot be deleted. "
+ "Details: %(reason)s")
+
+
class ClusterInstanceOperationNotSupported(TroveError):
message = _("Operation not supported for instances that are part of a "
"cluster.")
diff --git a/trove/common/strategies/cluster/experimental/mongodb/api.py b/trove/common/strategies/cluster/experimental/mongodb/api.py
index 05162261..b1a51da8 100644
--- a/trove/common/strategies/cluster/experimental/mongodb/api.py
+++ b/trove/common/strategies/cluster/experimental/mongodb/api.py
@@ -339,23 +339,23 @@ class MongoDbCluster(models.Cluster):
target_ids = set(instance_ids)
target_member_ids = target_ids.intersection(all_member_ids)
target_query_router_ids = target_ids.intersection(all_query_router_ids)
- other_ids = target_ids.difference(
+ target_configsvr_ids = target_ids.difference(
target_member_ids.union(target_query_router_ids)
)
- if other_ids:
- raise exception.TroveError(
- _('Instances %s cannot be deleted. MongoDB cluster shink only '
- 'supports removing replicas and query routers.')
- % list(other_ids)
+ if target_configsvr_ids:
+ raise exception.ClusterShrinkInstanceInUse(
+ id=list(target_configsvr_ids),
+ reason="Cannot remove config servers."
)
remaining_query_router_ids = all_query_router_ids.difference(
target_query_router_ids
)
if len(remaining_query_router_ids) < 1:
- raise exception.TroveError(
- _('Cannot delete all remaining query routers. At least one '
- 'query router must be available in the cluster.')
+ raise exception.ClusterShrinkInstanceInUse(
+ id=list(target_query_router_ids),
+ reason="Cannot remove all remaining query routers. At least "
+ "one query router must be available in the cluster."
)
if target_member_ids:
diff --git a/trove/common/strategies/cluster/experimental/redis/api.py b/trove/common/strategies/cluster/experimental/redis/api.py
index e85b5b0f..c325f2d2 100644
--- a/trove/common/strategies/cluster/experimental/redis/api.py
+++ b/trove/common/strategies/cluster/experimental/redis/api.py
@@ -20,8 +20,6 @@ from trove.cluster.tasks import ClusterTasks
from trove.cluster.views import ClusterView
from trove.common import cfg
from trove.common import exception
-from trove.common.exception import TroveError
-from trove.common.i18n import _
from trove.common import remote
from trove.common.strategies.cluster import base
from trove.extensions.mgmt.clusters.views import MgmtClusterView
@@ -162,11 +160,19 @@ class RedisCluster(models.Cluster):
try:
removal_insts = [inst_models.Instance.load(self.context, inst_id)
for inst_id in removal_ids]
- node_ids = [Cluster.get_guest(instance).get_node_id_for_removal()
- for instance in removal_insts]
- if None in node_ids:
- raise TroveError(_("Some nodes cannot be removed (check slots)"
- ))
+ node_ids = []
+ error_ids = []
+ for instance in removal_insts:
+ node_id = Cluster.get_guest(instance).get_node_id_for_removal()
+ if node_id:
+ node_ids.append(node_id)
+ else:
+ error_ids.append(instance.id)
+ if error_ids:
+ raise exception.ClusterShrinkInstanceInUse(
+ id=error_ids,
+ reason="Nodes cannot be removed. Check slots."
+ )
all_instances = (
inst_models.DBInstance.find_all(cluster_id=self.id,
diff --git a/trove/common/strategies/cluster/experimental/vertica/api.py b/trove/common/strategies/cluster/experimental/vertica/api.py
index 9ecb2e77..07d4a287 100644
--- a/trove/common/strategies/cluster/experimental/vertica/api.py
+++ b/trove/common/strategies/cluster/experimental/vertica/api.py
@@ -212,10 +212,16 @@ class VerticaCluster(models.Cluster):
db_info = self.db_info
datastore_version = self.ds_version
- db_instances = inst_models.DBInstance.find_all(cluster_id=db_info.id,
- deleted=False).all()
-
- all_instance_ids = [db_instance.id for db_instance in db_instances]
+ for db_instance in self.db_instances:
+ if db_instance.type == 'master':
+ if db_instance.id in instance_ids:
+ raise exception.ClusterShrinkInstanceInUse(
+ id=db_instance.id,
+ reason="Cannot remove master node."
+ )
+
+ all_instance_ids = [db_instance.id for db_instance
+ in self.db_instances]
left_instances = [instance_id for instance_id
in all_instance_ids
diff --git a/trove/guestagent/strategies/restore/mysql_impl.py b/trove/guestagent/strategies/restore/mysql_impl.py
index 6329d311..bc3a5e11 100644
--- a/trove/guestagent/strategies/restore/mysql_impl.py
+++ b/trove/guestagent/strategies/restore/mysql_impl.py
@@ -192,9 +192,12 @@ class InnoBackupEx(base.RestoreRunner, MySQLRestoreMixin):
"""Implementation of Restore Strategy for InnoBackupEx."""
__strategy_name__ = 'innobackupex'
base_restore_cmd = 'sudo xbstream -x -C %(restore_location)s'
- base_prepare_cmd = ('sudo innobackupex --apply-log %(restore_location)s'
+ base_prepare_cmd = ('sudo innobackupex'
' --defaults-file=%(restore_location)s/backup-my.cnf'
- ' --ibbackup xtrabackup 2>/tmp/innoprepare.log')
+ ' --ibbackup=xtrabackup'
+ ' --apply-log'
+ ' %(restore_location)s'
+ ' 2>/tmp/innoprepare.log')
def __init__(self, *args, **kwargs):
super(InnoBackupEx, self).__init__(*args, **kwargs)
@@ -233,11 +236,11 @@ class InnoBackupEx(base.RestoreRunner, MySQLRestoreMixin):
class InnoBackupExIncremental(InnoBackupEx):
__strategy_name__ = 'innobackupexincremental'
incremental_prep = ('sudo innobackupex'
+ ' --defaults-file=%(restore_location)s/backup-my.cnf'
+ ' --ibbackup=xtrabackup'
' --apply-log'
' --redo-only'
' %(restore_location)s'
- ' --defaults-file=%(restore_location)s/backup-my.cnf'
- ' --ibbackup xtrabackup'
' %(incremental_args)s'
' 2>/tmp/innoprepare.log')
diff --git a/trove/tests/unittests/guestagent/test_backups.py b/trove/tests/unittests/guestagent/test_backups.py
index 9ba5c854..2bc1ec7c 100644
--- a/trove/tests/unittests/guestagent/test_backups.py
+++ b/trove/tests/unittests/guestagent/test_backups.py
@@ -86,15 +86,21 @@ SQLDUMP_BACKUP_EXTRA_OPTS = (SQLDUMP_BACKUP_RAW %
{'extra_opts': '--events --routines --triggers'})
XTRA_RESTORE_RAW = "sudo xbstream -x -C %(restore_location)s"
XTRA_RESTORE = XTRA_RESTORE_RAW % {'restore_location': '/var/lib/mysql/data'}
-XTRA_INCR_PREPARE = ("sudo innobackupex --apply-log"
- " --redo-only /var/lib/mysql/data"
+XTRA_INCR_PREPARE = ("sudo innobackupex"
" --defaults-file=/var/lib/mysql/data/backup-my.cnf"
- " --ibbackup xtrabackup %(incr)s"
+ " --ibbackup=xtrabackup"
+ " --apply-log"
+ " --redo-only"
+ " /var/lib/mysql/data"
+ " %(incr)s"
" 2>/tmp/innoprepare.log")
SQLDUMP_RESTORE = "sudo mysql"
-PREPARE = ("sudo innobackupex --apply-log /var/lib/mysql/data "
- "--defaults-file=/var/lib/mysql/data/backup-my.cnf "
- "--ibbackup xtrabackup 2>/tmp/innoprepare.log")
+PREPARE = ("sudo innobackupex"
+ " --defaults-file=/var/lib/mysql/data/backup-my.cnf"
+ " --ibbackup=xtrabackup"
+ " --apply-log"
+ " /var/lib/mysql/data"
+ " 2>/tmp/innoprepare.log")
CRYPTO_KEY = "default_aes_cbc_key"
CBBACKUP_CMD = "tar cpPf - /tmp/backups"