Shift pause out of leveled

Leveled will now signal the need for a pause due to back-pressure, but
not actually pause itself.  The hope is that in a riak implementation
this pause can be managed by the put_fsm, and so not lock the store.
This commit is contained in:
martinsumner 2016-11-07 10:27:38 +00:00
parent 4583460328
commit 37c23a5b38
4 changed files with 28 additions and 44 deletions

View file

@ -157,7 +157,6 @@
-define(LEDGER_FP, "ledger").
-define(SNAPSHOT_TIMEOUT, 300000).
-define(CHECKJOURNAL_PROB, 0.2).
-define(SLOWOFFER_DELAY, 5).
-record(state, {inker :: pid(),
penciller :: pid(),
@ -277,11 +276,10 @@ handle_call({put, Bucket, Key, Object, IndexSpecs, Tag, TTL}, From, State) ->
% will beocme more frequent
case State#state.slow_offer of
true ->
timer:sleep(?SLOWOFFER_DELAY);
gen_server:reply(From, pause);
false ->
ok
gen_server:reply(From, ok)
end,
gen_server:reply(From, ok),
case maybepush_ledgercache(State#state.cache_size,
Cache0,
State#state.penciller) of