From 614d9f48cc38ec5d68d8440c6d929db40ac75440 Mon Sep 17 00:00:00 2001 From: Martin Sumner Date: Mon, 15 Jun 2020 21:06:06 +0100 Subject: [PATCH 1/2] Disable soft-limit check Modified version of https://github.com/basho/riak_kv/pull/1757 to allow cuttlefisk config setting of option via riak.conf --- priv/riak_kv.schema | 11 +++++++++++ src/riak_kv_put_fsm.erl | 5 ++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/priv/riak_kv.schema b/priv/riak_kv.schema index 75fade4265..52b0ae2a28 100644 --- a/priv/riak_kv.schema +++ b/priv/riak_kv.schema @@ -439,6 +439,17 @@ hidden ]}. +%% @doc Enable or disable mbox_check on PUTs +%% By default mbox_checks are performed so that vnodes with long queues +%% will not be used as put coordinators. To return to the pre-2.9 behaviour +%% of not checking, this can be disabled. The mbox_check may add additional +%% latency to PUTs in some environments. +{mapping, "mbox_check_enabled", "riak_kv.mbox_check_enabled", [ + {default, on}, + {datatype, flag}, + hidden +]} + %% @doc Controls which binary representation of a riak value is stored %% on disk. %% * 0: Original erlang:term_to_binary format. Higher space overhead. diff --git a/src/riak_kv_put_fsm.erl b/src/riak_kv_put_fsm.erl index 8764ab1466..8e5e9c6b2f 100644 --- a/src/riak_kv_put_fsm.erl +++ b/src/riak_kv_put_fsm.erl @@ -1269,7 +1269,10 @@ get_soft_limit_option(Options) -> %% both the system (post forward) and the client (via options) can %% turn off soft-limit checking. However, by default, we should %% use them (if supported) - SoftLimitedWanted = get_option(mbox_check, Options, SoftLimitSupported), + SoftLimitedWanted = + app_helper:get_env(riak_kv, mbox_check_enabled, true) andalso + SoftLimitSupported andalso + get_option(mbox_check, Options, SoftLimitSupported), SoftLimitedWanted. From b825588c929781f215cfdf0d5c6f0afcb4e5a8be Mon Sep 17 00:00:00 2001 From: Martin Sumner Date: Mon, 15 Jun 2020 21:23:36 +0100 Subject: [PATCH 2/2] Missing . --- priv/riak_kv.schema | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/priv/riak_kv.schema b/priv/riak_kv.schema index 52b0ae2a28..58cf934d12 100644 --- a/priv/riak_kv.schema +++ b/priv/riak_kv.schema @@ -448,7 +448,7 @@ {default, on}, {datatype, flag}, hidden -]} +]}. %% @doc Controls which binary representation of a riak value is stored %% on disk.