Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Fix repair handoff crash, missing not sent fun #339

Merged
merged 2 commits into from

2 participants

@engelsanchez
Collaborator

/cc @jrwest @javajolt
Partition repair was crashing on an undefined 'not sent function' in the handoff accumulator record. Jordan should know the details of the recent change that introduced him. Jordan: please review, feel free to replace with cleaner version of the fix.

Without this fix, the partition_repair riak_test fails every time. It passes with the fix.

src/riak_core_handoff_sender.erl
@@ -334,9 +334,13 @@ visit_item(K, V, Acc) ->
end;
false ->
+ NewNotSentAcc = case NotSentFun of
@jrwest
jrwest added a note

think it would be nice to pull this out into a separate function

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@jrwest

@engelsanchez code changes make sense. Left one style comment but I can address that while testing this change if you are busy. Will run the riak_test's later this evening when I get home.

@jrwest

@engelsanchez trying to run the test but getting the error below. Pretty sure its a riak_test config thing but I have spam_dir set in default section of config to existing directory and was getting different error until i untarrred the search-corpus tar. Any ideas?

20:20:14.029 [warning] partition_repair failed: {undef,[{rt,config_or_os_env,[spam_dir],[]},{partition_repair,confirm,0,[{file,"tests/partition_repair.erl"},{line,32}]}]}
20:20:14.030 [error] Error in process <0.94.0> on node 'riak_test@127.0.0.1' with exit value: {undef,[{rt,config_or_os_env,[spam_dir],[]},{partition_repair,confirm,0,[{file,"tests/partition_repair.erl"},{line,32}]}]}

EDIT: not that i think it affects things but this happens w/ or w/o this branch

@engelsanchez engelsanchez referenced this pull request in basho/riak_test
Merged

Fix aftermath of rt_config refactor #309

@jrwest

pushed a small cleanup commit for the comment I left (re: refactoring). partition_repair, with recent riak_test fixes, passes with this change and fails w/o. Thanks for finding & fixing this @engelsanchez. +1.

@engelsanchez engelsanchez merged commit 500be1d into from
@engelsanchez engelsanchez deleted the branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jun 15, 2013
  1. @engelsanchez
Commits on Jun 17, 2013
  1. @jrwest
This page is out of date. Refresh to see the latest.
Showing with 7 additions and 1 deletion.
  1. +7 −1 src/riak_core_handoff_sender.erl
View
8 src/riak_core_handoff_sender.erl
@@ -334,11 +334,17 @@ visit_item(K, V, Acc) ->
end;
false ->
+ NewNotSentAcc = handle_not_sent_item(NotSentFun, NotSentAcc, K),
Acc#ho_acc{error=ok,
total_objects=TotalObjects+1,
- notsent_acc=NotSentFun(K, NotSentAcc)}
+ notsent_acc=NewNotSentAcc}
end.
+handle_not_sent_item(undefined, _, _) ->
+ undefined;
+handle_not_sent_item(NotSentFun, Acc, Key) when is_function(NotSentFun) ->
+ NotSentFun(Key, Acc).
+
send_objects([], Acc) ->
Acc;
send_objects(ItemsReverseList, Acc) ->
Something went wrong with that request. Please try again.