From df6ac5c60784d0e85ee4e3f62db12cb2c3c3bc3a Mon Sep 17 00:00:00 2001 From: Martin Sumner Date: Wed, 13 Sep 2023 13:19:24 +0100 Subject: [PATCH] Updates following review --- priv/riak_kv.schema | 9 ++++++++- src/riak_kv_reaper.erl | 5 +++++ src/riak_kv_replrtq_snk.erl | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/priv/riak_kv.schema b/priv/riak_kv.schema index 9e5ac234d..e05177ad3 100644 --- a/priv/riak_kv.schema +++ b/priv/riak_kv.schema @@ -1337,13 +1337,20 @@ {default, "q1_ttaaefs:block_rtq"} ]}. -%% @doc Enable this node zlib compress objects over the wire +%% @doc Enable this node to zlib compress objects over the wire {mapping, "replrtq_compressonwire", "riak_kv.replrtq_compressonwire", [ {datatype, {flag, enabled, disabled}}, {default, disabled}, {commented, enabled} ]}. +%% @doc Enable this node to replicate reap requests to other clusters +{mapping, "repl_reap", "riak_kv.repl_reap", [ + {datatype, {flag, enabled, disabled}}, + {default, disabled}, + {commented, enabled} +]}. + %% @doc Enable this node to act as a sink and consume from a src cluster {mapping, "replrtq_enablesink", "riak_kv.replrtq_enablesink", [ {datatype, {flag, enabled, disabled}}, diff --git a/src/riak_kv_reaper.erl b/src/riak_kv_reaper.erl index dff943eb0..08cae2b32 100644 --- a/src/riak_kv_reaper.erl +++ b/src/riak_kv_reaper.erl @@ -64,6 +64,11 @@ -type reap_reference() :: {{riak_object:bucket(), riak_object:key()}, vclock:vclock(), boolean()}. + %% the reap reference is {Bucket, Key, Clock (of tombstone), Forward}. The + %% Forward boolean() indicates if this reap should be replicated if + %% riak_kv.repl_reap is true. When a reap is received via replication + %% Forward should be set to false, to prevent reaps from perpetually + %% circulating -type job_id() :: pos_integer(). -export_type([reap_reference/0, job_id/0]). diff --git a/src/riak_kv_replrtq_snk.erl b/src/riak_kv_replrtq_snk.erl index 3c12fb37f..4803d39a1 100644 --- a/src/riak_kv_replrtq_snk.erl +++ b/src/riak_kv_replrtq_snk.erl @@ -725,7 +725,7 @@ repl_fetcher(WorkItem) -> SWPushed = os:timestamp(), FetchSplit = timer:now_diff(SWFetched, SW), PushSplit = timer:now_diff(SWPushed, SWFetched), - ModSplit =timer:now_diff(SWPushed, LMD), + ModSplit = timer:now_diff(SWPushed, LMD), ok = riak_kv_stat:update(ngrrepl_object), done_work(WorkItem, true, {object, FetchSplit, PushSplit, ModSplit});