For the Percona XtraDB Cluster (pxc) datastore we need the ability to grow and shrink a cluster. This will add these 2 core features to the pxc solution we currently have.
Launchpad Blueprint: https://blueprints.launchpad.net/trove/+spec/pxc-grow-shrink-cluster
PXC is lacking support for grow and shrink clusters. This will allow a user to create a new instance in the cluster and delete an existing instance from the cluster.
An example use case would be if an instance in the cluster is having issues due to the underlying hardware, network, or other issues then a user can remove the instance and create a new one to keep the cluster healthy.
PXC will use the existing grow and shrink API calls and implement them for the pxc manager. This change will allow the cluster to be heterogeneous when needing to grow or shrink the cluster. A heterogeneous cluster means that the flavor and volume may not all be the same for every instance in a cluster.
Requirements for grow:
Requirements for shrink:
A few new guestagent API calls will be needed in order for grow to work.
PXC handles joining a cluster automatically when given an ip address of one of the nodes in the existing cluster. When given all the ips of the existing cluster instances PXC will sequentially attempt to connect to the ips in the list and attempt to join the cluster. If one of the instances in the list is not up (crash or network or otherwise and issue) then PXC will try the next ip in the list. This will help allow a user to join a new instance to the cluster so that they can then shrink or remove the problematic instance from the cluster.
No configuration changes are anticipated.
The following public API calls will be made available to the PXC datastore.
Support for the following existing CLI calls.
No changes should be nessesary to accomplish these actions.
There are few new guestagent calls that will need to be made to get the data from the existing instances in the cluster as well as updating the cluster configuration on the existing instances. 
The process of growing the cluster or adding a new instance(s) to the cluster:
The process of shrinking a cluster is removing a given instance(s) from the cluster:
Like mentioned above in the Internal API section there will be a few new guestagent calls to support grow and shrink.
Methods added to the Guest Agent
No calls will be deprecated in order to complete this.
Not to support grow and shrink of a pxc cluster.
TBD (section added after approval)
Targeting this for milestone: Mitaka
This work will be broken up into 2 separate items.
The guestagents on the existing cluster instances must be updated prior to calling the grow or shrink API calls. Otherwise the cluster may get stuck in a GROWING_CLUSTER or SHRINKING_CLUSTER state, because the guestagent will not have the calls to support growing or shrinking a cluster.
There will be unit tests that test the new calls for the strategy.
There will be integration tests which will test grow and shrink cluster features.
We need to update the docs to show support for grow and shrink clusters for the pxc manager.