diff --git a/priv/riak_kv.schema b/priv/riak_kv.schema index c8c6f2c1c..cdee70da0 100644 --- a/priv/riak_kv.schema +++ b/priv/riak_kv.schema @@ -1492,4 +1492,11 @@ {datatype, {flag, enabled, disabled}}, {default, disabled}, hidden +]}. + +%% @doc When doing handoffs, forward delete requests so that if the delete_mode +%% is not keep, tombstones will still be reaped. +{mapping, "handoff_deletes", "riak_kv.handoff_deletes", [ + {datatype, {flag, enabled, disabled}}, + {default, disabled} ]}. \ No newline at end of file diff --git a/rebar.config b/rebar.config index b5ad6d55a..b53501669 100644 --- a/rebar.config +++ b/rebar.config @@ -52,6 +52,6 @@ {riak_dt, {git, "https://github.com/basho/riak_dt.git", {tag, "riak_kv-3.0.0"}}}, {riak_api, {git, "https://github.com/basho/riak_api.git", {tag, "riak_kv-3.0.13"}}}, {hyper, {git, "https://github.com/basho/hyper", {tag, "1.1.0"}}}, - {kv_index_tictactree, {git, "https://github.com/martinsumner/kv_index_tictactree.git", {tag, "1.0.5"}}}, + {kv_index_tictactree, {git, "https://github.com/martinsumner/kv_index_tictactree.git", {branch, "develop-3.0"}}}, {riakhttpc, {git, "https://github.com/basho/riak-erlang-http-client", {tag, "3.0.13"}}} ]}. diff --git a/src/riak_kv_vnode.erl b/src/riak_kv_vnode.erl index 1fc0a1846..37f3f885d 100644 --- a/src/riak_kv_vnode.erl +++ b/src/riak_kv_vnode.erl @@ -2326,6 +2326,15 @@ handle_handoff_request(kv_w1c_put_request, Request, Sender, State) -> NewState end, {forward, NewState0}; +handle_handoff_request(kv_delete_request, Request, Sender, State) -> + HandoffDeletes = app_helper:get_env(riak_kv, handoff_deletes), + case {HandoffDeletes, handle_command(Request, Sender, State)} of + {true, {reply, {del, Idx, Reason}, NewState}} -> + riak_core_vnode:reply(Sender, {del, Idx, Reason}), + {forward, NewState}; + {_, Result} -> + Result + end; handle_handoff_request(_Other, Req, Sender, State) -> %% @todo: this should be based on the type of the request when the %% hiding of records is complete.