basho/riak_kv — pull request #483 by jtuple (2013-02-08 20:19:14+00:00)
Title: Improve AAE backpressure on K/V vnode write-path

Original AAE design had `riak_kv_vnode` send async casts to the `riak_kv_index_hashtree` to decouple the two processes and ensure AAE had little impact on K/V performance. Testing uncovered issues where the K/V vnode could operate faster the AAE hashtree, leading to unbounded message queue growth. To fix this, the updates were changes to be synchronous calls to add backpressure.

However, doing a blocking call for every update impacts K/V performance. This is especially noticeable when running a fast backend, such as Memory or Bitcask. This commit moves to a hybrid approach. A fixed number of updates are sent asynchronously after which the next update is performed synchronously. The value is currently hardcoded to 90 asynchronous requests. The worse-case message queue size is therefore 91 outstanding messages.