~james-page/charms/trusty/percona-cluster/le-loc

« back to all changes in this revision

Viewing changes to hooks/percona_hooks.py

  • Committer: james.page at ubuntu
  • Date: 2015-03-13 15:47:34 UTC
  • Revision ID: james.page@ubuntu.com-20150313154734-pcx9hu02eqssiec5
Restore seeding markers

Show diffs side-by-side

added added

removed removed

Lines of Context:
135
135
    render_config(clustered, hosts)
136
136
    if file_hash(MY_CNF) != pre_hash:
137
137
        try:
138
 
            # NOTE(jamespage): don't restart the leader as this
139
 
            # should be the source of initial syncs for pxc
140
 
            if not is_leader():
 
138
            # NOTE(jamespage): try with leadership election
 
139
            if clustered and not is_leader() and not seeded():
141
140
                # Bootstrap node into seeded cluster
142
141
                service_restart('mysql')
 
142
                mark_seeded()
 
143
            elif not clustered:
 
144
                # Restart with new configuration
 
145
                service_restart('mysql')
143
146
        except NotImplementedError:
144
147
            # NOTE(jamespage): fallback to legacy behaviour.
145
148
            oldest = oldest_peer(peer_units())