Skip to content

Commit

Permalink
Promote threshold count to riak.conf configuration (#997)
Browse files Browse the repository at this point in the history
  • Loading branch information
martinsumner authored Feb 10, 2023
1 parent ad546ed commit 10cad32
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
10 changes: 10 additions & 0 deletions priv/riak_core.schema
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,16 @@
{commented, 2}
]}.

%% @doc Handoff batch threshold count
%% The maximum number of objects allowed in a single handoff batch. If there
%% are issues with handoff timeouts, then the first change should be to reduce
%% this count - making the system more responsive to back-pressure.
{mapping, "handoff_batch_threshold_count", "riak_core.handoff_batch_threshold_count", [
{datatype, integer},
{default, 500},
{commented, 500}
]}.

%% @doc Default location of ringstate
{mapping, "ring.state_dir", "riak_core.ring_state_dir", [
{datatype, directory},
Expand Down
7 changes: 3 additions & 4 deletions src/riak_core_handoff_sender.erl
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
-include("riak_core_vnode.hrl").
-include("riak_core_handoff.hrl").
-include("stacktrace.hrl").
-define(ACK_COUNT, 1000).
%% can be set with env riak_core, handoff_timeout
-define(TCP_TIMEOUT, 60000).
%% can be set with env riak_core, handoff_status_interval
Expand Down Expand Up @@ -150,17 +149,17 @@ start_fold(TargetNode, Module, {Type, Opts}, ParentPid, SslOpts) ->
AckLogThreshold =
app_helper:get_env(
riak_core, handoff_acklog_threshold, 100),
% As the batch size if 1MB, this will log progress every 100MB
% If the batch size is 1MB, this will log progress every 100MB
HandoffBatchThresholdSize =
app_helper:get_env(
riak_core, handoff_batch_threshold, 1024 * 1024),
% Batch threshold is in bytes
HandoffBatchThresholdCount =
app_helper:get_env(
riak_core, handoff_batch_threshold_count, 1000),
riak_core, handoff_batch_threshold_count, 500),
% Batch threshold as a count of objects. If the handoff_timeout
% is 60s, this requires the receiver vnode to handle each handoff
% item in less than 60ms (assuming the fold to crate the batch is
% item in less than 120ms (assuming the fold to create the batch is
% fast).

%% Since handoff_concurrency applies to both outbound and inbound
Expand Down

0 comments on commit 10cad32

Please sign in to comment.