Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Why enable-database-replication needs a restart?

The doc says:

--[no-]enable-database-replication: Enable database replication. Applicable only for read replica instance(s). WARNING: Instance will be restarted.

Why enable or disable de replication needs a restart?

Is there any way to just do a STOP REPLICA?

STOP REPLICA SQL_THREAD;
START REPLICA SQL_THREAD; 

 

0 1 280
1 REPLY 1

Hi @jnunez_clicars,

Welcome to Google Cloud Community!

Please be advised that Google Cloud SQL is a fully managed RDBMS meaning that not all functions of MySQL, PostgreSQL, and SQL Server will work or is compatible with it.

Enabling or disabling read replica needed a restart to change its status to replicating the primary instance or as read-only. Basically even if read replica is disabled, users can still access it up to the point when it was disabled.

A similar function to start or stop replica is as follows:

Disable replication

gcloud sql instances patch REPLICA_NAME \
--no-enable-database-replication

Enable replication

gcloud sql instances patch REPLICA_NAME \
--enable-database-replication

 You can check the following documentations on Cloud SQL features and managing read replicas: