Cleanup reactive states handling and expose replset relation parameter #6

Open
wants to merge 2 commits into
from

Conversation

Projects
None yet
1 participant
Contributor

dshcherb commented Feb 13, 2017

This PR is attempts to make state handling better by deleting set_state("*.removed") calls and adding calls to actually remove .available states.

The second patch exposes the replset parameter of a relation which is already present in the mongodb charm code:
https://bazaar.launchpad.net/~charmers/charms/trusty/mongodb/trunk/view/head:/hooks/hooks.py#L1141

Some applications (like zaqar) require replicated or sharded configurations only and do not work with standalone instances which is why the change is needed.

dshcherb added some commits Feb 13, 2017

Remove states on breakage/disconnection
Instead of setting new states - remove them, otherwise, a situation
will be possible where two states are set indicating that the relation
data is both available and not available.

Signed-off-by: Dmitrii Shcherbakov <dmitrii.shcherbakov@canonical.com>
Expose replset param and set the respective state
Some applications require replicaset parameter appended to the mongodb
connection string. For example, zaqar-server does not allow
connections to individual mongodb instances without replset. The
service simply fails after start.

The mongodb charm itself already exports that argument and does a
relation_set. However, reactive charms that might use this interface
are not able to use this parameter without the introduced code.

Also, for granularity, a new state is introduced to distinguish the
states where only a connection string is available from the state where
replset is available.

Signed-off-by: Dmitrii Shcherbakov <dmitrii.shcherbakov@canonical.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment