Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't find riak_core_coverage_fsm #109

Open
onetamer opened this issue Oct 22, 2021 · 4 comments
Open

Can't find riak_core_coverage_fsm #109

onetamer opened this issue Oct 22, 2021 · 4 comments

Comments

@onetamer
Copy link

I'd like to implement some coverage calls but it looks like riak_core_coverage_fsm.erl can't be found. I checked the Riak Core main repo and it seems to be available here: https://github.com/basho/riak_core/blob/develop-3.0/src/riak_core_coverage_fsm.erl

Is this file not supposed to be included in Riak Core Lite?

@ukazap
Copy link

ukazap commented Feb 28, 2022

Hi, having the same issue following the tutorial.
The sample tanodb project also seems to use riak_core as one of its dependencies.

@albsch
Copy link
Member

albsch commented Feb 28, 2022

The riak_core_coverage_fsm is not directly supported in riak_core_lite, it's supposed to be in riak_core_lite_utils, here. Any updates on that @marianoguerra ? I vaguely recall we postponed adding it because it encourages inefficient access patterns, but I forgot about our plans on that.

@heri16
Copy link

heri16 commented Apr 16, 2022

What are the things missing that is required to get riak_pipe working with riak_core_lite?

@albsch
Copy link
Member

albsch commented Apr 17, 2022

I haven't tried out running riak_pipe, but at a glance riak_core_coverage_fsm and some small modifications are needed.

To get it to compile with riak_core_lite:

  1. Change to riak_core_lite dependency
  2. Copy riak_core_coverage_fsm.erl from somewhere to src.
  3. Add missing callbacks to riak_pipe_vnode and replace ?FOLDREQ with the record definition
diff --git a/rebar.config b/rebar.config
index 1c9c6d3..fb08940 100644
--- a/rebar.config
+++ b/rebar.config
@@ -11,7 +11,7 @@
 {xref_checks,[undefined_function_calls,undefined_functions,locals_not_used]}.
 
 {deps, [
-        {riak_core, ".*", {git, "https://github.com/basho/riak_core.git", {branch, "develop"}}}
+        {riak_core, "0.10.3", {pkg, riak_core_lite}}
        ]}.
 
 {plugins, [{eqc_rebar, {git, "https://github.com/Quviq/eqc-rebar", {branch, "master"}}}]}.
diff --git a/src/riak_pipe_vnode.erl b/src/riak_pipe_vnode.erl
index b1da35a..ffb3a05 100644
--- a/src/riak_pipe_vnode.erl
+++ b/src/riak_pipe_vnode.erl
@@ -39,6 +39,8 @@
          handle_exit/3,
          handle_info/2,
          handle_coverage/4]).
+-export([handle_overload_command/3, 
+         handle_overload_info/2]).
 -export([queue_work/2,
          queue_work/3,
          queue_work/4,
@@ -521,7 +523,7 @@ handle_command(Message, _Sender, State) ->
          {reply, term(), state()}
        | {noreply, state()}
        | {forward, state()}.
-handle_handoff_command(?FOLD_REQ{}=Cmd, Sender, State) ->
+handle_handoff_command(#riak_core_fold_req_v2{}=Cmd, Sender, State) ->
     handoff_cmd_internal(Cmd, Sender, State);
 handle_handoff_command(#riak_core_fold_req_v1{}=Cmd, Sender, State) ->
     handoff_cmd_internal(riak_core_util:make_newest_fold_req(Cmd),
@@ -1251,7 +1253,7 @@ proplist_perf(#worker{perf=Perf, state=State}) ->
 %%      archive as they finish their current inputs.
 -spec handoff_cmd_internal(term(), sender(), state()) ->
          {noreply, state()}.
-handoff_cmd_internal(?FOLD_REQ{foldfun=Fold, acc0=Acc}, Sender,
+handoff_cmd_internal(#riak_core_fold_req_v2{foldfun=Fold, acc0=Acc}, Sender,
               #state{workers=Workers}=State) ->
     {Ready, NotReady} = lists:partition(
                           fun(W) -> W#worker.state == waiting end,
@@ -1310,3 +1312,7 @@ archive_internal(#cmd_archive{fitting=F, archive=A},
     end,
     {noreply, State#state{workers_archiving=NewArchiving,
                           handoff=Handoff#handoff{acc=NewAcc}}}.
+
+
+handle_overload_command(_Request, _Sender, _Idx) -> ok.
+handle_overload_info(_Request, _Idx) -> ok.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants