Metaswitch/sprout — pull request #262 by mike-evans (2013-10-20 11:43:01+00:00)
Title: [Reviewer Matt] Changes to memcached redundancy

Matt

Can you review these changes please. The main change is to the way the memcached_st structures are allocated and replicas chosen for each read/write operation. Previously there was a memcached_st for each level of replication, with a separate vbucket configuration for each memcached_st. That didn't work in the new scheme so I've had to stop using the libmemcached vbucket support and keep track of vbuckets in the store code instead. This means we have to create a memached_st for each server in the list, then choose the memcached_st to use for each read/write based on the vbucket configuration.

This means more memcached_st's than previously, but fewer TCP connections to the back-end servers (previously there would have been 2x the number of servers x the number of worker threads, now it is just 1x).

This has been tested mostly live, both checking the vbucket configurations are as expected and checking that scale-up works without dropping any calls even when a memcached server is down.

Note that this pull request doesn't include the changes to reenable geo-redundancy - I'm doing that as a separate branch.

Mike