Just to be clear bootstrap-pxc *will* be run more than once. After the cluster has been bootstrapped any config-changed run that changes the config file will "re-bootstrap" on the leader. This may not be your intent.
In config-changed bootstrapped is defaulted to False and therefore the leader will run render_config_restart_on_changed with bootstrap=True:
elif clustered and is_leader(): log("Leader unit - bootstrap required=%s" % (not bootstrapped), DEBUG) render_config_restart_on_changed(clustered, hosts, bootstrap=not bootstrapped)
And in render_config_restart_on_changed if the config file has been changed it will "re-bootstrap" rather than restart:
if file_hash(MY_CNF) != pre_hash:
if bootstrap: service('bootstrap-pxc', 'mysql') notify_bootstrapped() update_shared_db_rels()
else: service_restart('mysql')
> Oh and yes, bootstrap-pxc is idempotent.
Excellent.
Just to be clear bootstrap-pxc *will* be run more than once. After the cluster has been bootstrapped any config-changed run that changes the config file will "re-bootstrap" on the leader. This may not be your intent.
In config-changed bootstrapped is defaulted to False and therefore the leader will run render_ config_ restart_ on_changed with bootstrap=True:
elif clustered and is_leader():
log(" Leader unit - bootstrap required=%s" % (not bootstrapped),
DEBUG)
render_ config_ restart_ on_changed( clustered, hosts,
bootstrap= not bootstrapped)
And in render_ config_ restart_ on_changed if the config file has been changed it will "re-bootstrap" rather than restart:
if file_hash(MY_CNF) != pre_hash:
service( 'bootstrap- pxc', 'mysql')
notify_ bootstrapped( )
update_ shared_ db_rels( )
service_ restart( 'mysql' )
if bootstrap:
else: