From df4f74769ee731c57cf8dcef01dec8946baa58c6 Mon Sep 17 00:00:00 2001 From: Lingxian Kong Date: Sat, 12 Sep 2020 17:06:23 +1200 Subject: [PATCH] Fix some API calls for PostgreSQL Change-Id: Ia42c72dd3ce88b083b55fa73936b81c78da21166 --- trove/guestagent/datastore/manager.py | 3 +++ trove/guestagent/datastore/mysql_common/manager.py | 3 --- trove/guestagent/datastore/mysql_common/service.py | 2 +- trove/guestagent/datastore/postgres/service.py | 2 +- trove/templates/postgresql/validation-rules.json | 6 +++--- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/trove/guestagent/datastore/manager.py b/trove/guestagent/datastore/manager.py index 979919db76..b9e86bcec6 100644 --- a/trove/guestagent/datastore/manager.py +++ b/trove/guestagent/datastore/manager.py @@ -316,6 +316,9 @@ class Manager(periodic_task.PeriodicTasks): LOG.info('No post_prepare work has been defined.') pass + def start_db_with_conf_changes(self, context, config_contents, ds_version): + self.app.start_db_with_conf_changes(config_contents, ds_version) + def stop_db(self, context): self.app.stop_db() diff --git a/trove/guestagent/datastore/mysql_common/manager.py b/trove/guestagent/datastore/mysql_common/manager.py index 77f4129484..854d1348f2 100644 --- a/trove/guestagent/datastore/mysql_common/manager.py +++ b/trove/guestagent/datastore/mysql_common/manager.py @@ -106,9 +106,6 @@ class MySqlManager(manager.Manager): # This instance is a replication slave self.attach_replica(context, snapshot, snapshot['config']) - def start_db_with_conf_changes(self, context, config_contents, ds_version): - self.app.start_db_with_conf_changes(config_contents, ds_version) - def create_backup(self, context, backup_info): """Create backup for the database. diff --git a/trove/guestagent/datastore/mysql_common/service.py b/trove/guestagent/datastore/mysql_common/service.py index 67b2145405..c8bd6f8b02 100644 --- a/trove/guestagent/datastore/mysql_common/service.py +++ b/trove/guestagent/datastore/mysql_common/service.py @@ -654,7 +654,7 @@ class BaseMySqlApp(service.BaseDbApp): if not self.status.wait_for_status( service_status.ServiceStatuses.HEALTHY, - CONF.state_change_wait_time, update_db=False + CONF.state_change_wait_time, update_db=True ): raise exception.TroveError("Failed to start mysql") diff --git a/trove/guestagent/datastore/postgres/service.py b/trove/guestagent/datastore/postgres/service.py index 39d26df309..e5d3c7e04a 100644 --- a/trove/guestagent/datastore/postgres/service.py +++ b/trove/guestagent/datastore/postgres/service.py @@ -231,7 +231,7 @@ class PgSqlApp(service.BaseDbApp): if not self.status.wait_for_status( service_status.ServiceStatuses.HEALTHY, - CONF.state_change_wait_time, update_db=False + CONF.state_change_wait_time, update_db=True ): raise exception.TroveError("Failed to start database") diff --git a/trove/templates/postgresql/validation-rules.json b/trove/templates/postgresql/validation-rules.json index 571edc856a..f68f17566a 100644 --- a/trove/templates/postgresql/validation-rules.json +++ b/trove/templates/postgresql/validation-rules.json @@ -224,7 +224,7 @@ { "name": "checkpoint_timeout", "restart_required": false, - "type": "string" + "type": "integer" }, { "name": "checkpoint_completion_target", @@ -238,14 +238,14 @@ }, { "name": "wal_keep_segments", - "restart_required": false, + "restart_required": true, "min": 0, "type": "integer" }, { "name": "wal_sender_timeout", "restart_required": false, - "type": "string" + "type": "integer" }, { "name": "synchronous_standby_names",