Skip to content

Commit 490cd21

Browse files
authored
Merge pull request #703 from basho/dr-better_required_queue_list
Prevent fallback vnodes' solrqs from stopping if they are still needed
2 parents 381e573 + e228268 commit 490cd21

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/yz_solrq_sup.erl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,14 +104,14 @@ validate_child_started(Error) ->
104104
throw(Error).
105105

106106
required_queues() ->
107-
{ok, Ring} = riak_core_ring_manager:get_my_ring(),
108-
Partitions = yz_misc:owned_and_next_partitions(node(), Ring),
107+
AllVnodes = riak_core_vnode_manager:all_vnodes(riak_kv_vnode),
108+
Partitions = [Idx || {_Mod, Idx, _Pid} <- AllVnodes],
109109
%% Indexes includes ?YZ_INDEX_TOMBSTONE because we need to write the entries
110110
%% for non-indexed data to the YZ AAE tree. Excluding them makes this process
111111
%% constantly start and stop these queues.
112112
Indexes = yz_index:get_indexes_from_meta() ++ [?YZ_INDEX_TOMBSTONE],
113113
CalculatedQueues = [{Index, Partition} ||
114-
Partition <- ordsets:to_list(Partitions),
114+
Partition <- Partitions,
115115
Index <- Indexes],
116116
CalculatedQueues.
117117
%% TODO: we shouldn't need ?YZ_INDEX_TOMBSTONE if we just update the YZ AAE tree

test/yz_solrq_eqc.erl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -572,8 +572,10 @@ wait_for_vnodes_msgs([Pid | Pids], Ref) ->
572572

573573
start_solrqs(Partitions, Indexes) ->
574574
%% Ring retrieval for required workers
575-
meck:expect(riak_core_ring_manager, get_my_ring, fun() -> {ok, not_a_real_ring} end),
576-
meck:expect(yz_misc, owned_and_next_partitions, fun(_, _) -> unique_entries(Partitions) end),
575+
UniquePartitions = unique_entries(Partitions),
576+
meck:expect(riak_core_vnode_manager, all_vnodes, fun(riak_kv_vnode) ->
577+
[{riak_kv_vnode, Idx, fake_pid} || Idx <- UniquePartitions]
578+
end),
577579
meck:expect(yz_index, get_indexes_from_meta, fun() -> unique_entries(Indexes) -- [?YZ_INDEX_TOMBSTONE] end),
578580
%% And start up supervisors to own the solrq/solrq helper
579581
_ = yz_solrq_sup:start_link(),

0 commit comments

Comments
 (0)