basho/riak_kv — pull request #754 by slfritchie (2013-12-10 11:26:57+00:00)
Title: Add timer:sleep()-based throttle to riak_kv_exchange_fsm:read_repair_keydiff()

Note: this PR is against the `1.4` branch.

The throttle part is easy: a 1-liner. The rest is the infrastructure
to poll each node for its maximum vnode mailbox queue length, pick the
worst one, calculate a sleep time based on a list of {Q_length, SleepMSec},
and communicate via time-honored application env vars.

The only hot code path that reads the ETS table for app env vars is
riak_kv_exchange_fsm:read_repair_keydiff() itself, and since it is
doing a full KV get FSM plus other stuff, the extra heat on the hot
path is insignificant.

@joedevivo I'd appreciate some cuttlefish advice on how to go about
crafting the value of the {riak_kv, aae_throttle_limits} in a cuttlefish
config: `list({integer(), non_neg_integer()})`. Once I have that figured out,
then I can create an expanded PR for `develop`.