-
Notifications
You must be signed in to change notification settings - Fork 182
Mv riak 1 4 cleanup
- merged to "master" July 11, 2013
- developer tested code checked-in July 10, 2013
- development started July 9, 2013
Riak 1.3 included changes to the Erlang NIF interface to leveldb (see basho/eleveldb repository). These changes forced all interactions between Erlang and leveldb to change threads when crossing eleveldb. All kinds of implicit timing and throughput parameters changed with the new NIF interface.
Also the new Riak feature Active Anti-Entropy (AAE) was added in Riak 1.3. It too created new throughput challenges.
The result was that an entirely new write throttle was written for Riak 1.3. The code was written piecemeal (hacked) within env_posix.cc. It was subsequently tuned for even better performance in Riak 1.4, but left within env_posix.cc.
This branch merely moves the 1.3 write throttle to its own source files: util/throttle.cc and util/throttle.h. And corrects one routine that relied upon an incorrect mutex.
-
Copy / paste throttle code (and tiered locks) from env_posix.cc/env.h to throttle.cc/.h
-
Correct SetThrottleWriteRate() (previously Env::SetWriteRate) to properly use gThrottleMutex instead of Env::mu_
Note: The code now in throttle.cc/.h is written more like C code instead of a C++ class. This is just laziness. It would be good to clean this up further when time allows.