~james-page/charms/trusty/mysql/kilo-support

Viewing all changes in revision 125.

  • Committer: james.page at ubuntu
  • Date: 2014-09-12 10:24:33 UTC
  • mfrom: (124.1.5 lp-1353135)
  • Revision ID: james.page@ubuntu.com-20140912102433-dfsfxi04rhp5nq3l
[gnuoy,r=james-page,t=james-page] Set allowed_hosts data on shared-db relations

Set a list of allowed_units which the client units can query to see if their permissions have been setup yet. The reason for this is to allow the client to work around a race condition which occurs when a service has multiple units:

1) A service consisting of multiple units joins mysql and triggers mysql to run shared-db-changed for each unit in turn. But as soon as shared-db-changed has been run for the *first* time mysql runs relation set publishing the password.

2) All units in the client service then run their shared-db-changed hook in response to the relation set that mysql issued when it did the *first* run of shared-db-changed. At this point permissions have only been granted to one unit and the rest will fail if they try and access the db.

This is the same behaviour as the postgres charm which was added in response to Bug #1187508

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: