Skip to content

Commit c1ecc9f

Browse files
author
Doug Rohrer
committed
Update pipe_verify_handoff_blocking to handle the occasional error where
a vnode has been transferred after the vnode proxy has gotten its pid but before the work can be sent.
1 parent 5f01423 commit c1ecc9f

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

tests/pipe_verify_handoff_blocking.erl

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -43,17 +43,6 @@
4343
%% archive), but we don't want them to process so many inputs that
4444
%% they consume their blocking queues before handing off.
4545

46-
%% Please Note: Under rare circumstances, this test may fail with a
47-
%% "{badmatch,{error,[{vnode_down,noproc}]}}' error. This is not a
48-
%% failure of this test but rather a side effect of a race condition
49-
%% in riak_core_vnode_proxy. It manifests due to the fact that the
50-
%% test is attempting to send a command to a vnode that is in fact
51-
%% down, however monitor only works by issuing a command and getting
52-
%% a PID. In some instances, get_vnode_pid fails because vnode shutdown
53-
%% is queued up in the mailbox before monitor node. Unfortunately, the
54-
%% fix would require a fundamental shift in the architecture of
55-
%% riak_core, which at the time of this writing is not feasible for
56-
%% this rare failure case.
5746
-module(pipe_verify_handoff_blocking).
5847

5948
-export([
@@ -175,7 +164,11 @@ queue_filler(Node, Pipe, Inputs, Count) ->
175164
{stop, Owner} -> Owner ! {done, Count}
176165
after 0 ->
177166
{{value, I}, Q} = queue:out(Inputs),
178-
ok = rpc:call(Node, riak_pipe, queue_work, [Pipe, I]),
167+
case rpc:call(Node, riak_pipe, queue_work, [Pipe, I]) of
168+
ok -> ok;
169+
{error,[{vnode_down,noproc}]} -> ok; %% OK if vnode has moved to different node - next request should succeed
170+
Other -> throw(Other)
171+
end,
179172
queue_filler(Node, Pipe, queue:in(I, Q), Count+1)
180173
end.
181174

0 commit comments

Comments
 (0)