Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add the ability to repair a Search partition. If a partition's data is lost or corrupted this command may be used to rebuild it from adjacent partitions. This is preferable over a list-keys + re-index since it is more targeted, should complete more quickly and should put less strain on the cluster.
- Loading branch information
Showing
5 changed files
with
150 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,46 @@ | |||
%% ------------------------------------------------------------------- | |||
%% | |||
%% Copyright (c) 2012 Basho Technologies, Inc. All Rights Reserved. | |||
%% | |||
%% This file is provided to you under the Apache License, | |||
%% Version 2.0 (the "License"); you may not use this file | |||
%% except in compliance with the License. You may obtain | |||
%% a copy of the License at | |||
%% | |||
%% http://www.apache.org/licenses/LICENSE-2.0 | |||
%% | |||
%% Unless required by applicable law or agreed to in writing, | |||
%% software distributed under the License is distributed on an | |||
%% "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | |||
%% KIND, either express or implied. See the License for the | |||
%% specific language governing permissions and limitations | |||
%% under the License. | |||
%% | |||
%% ------------------------------------------------------------------- | |||
|
|||
-module(riak_search_worker). | |||
-behaviour(riak_core_vnode_worker). | |||
|
|||
-export([init_worker/3, | |||
handle_work/3]). | |||
|
|||
-include_lib("riak_core/include/riak_core_vnode.hrl"). | |||
-record(state, {index :: partition()}). | |||
|
|||
%% =================================================================== | |||
%% Public API | |||
%% =================================================================== | |||
|
|||
%% @doc Initialize the worker. Currently only the VNode index | |||
%% parameter is used. | |||
init_worker(VNodeIndex, _Args, _Props) -> | |||
{ok, #state{index=VNodeIndex}}. | |||
|
|||
%% @doc Perform the asynchronous fold operation. | |||
handle_work({fold, FoldFun, FinishFun}, _Sender, State) -> | |||
try | |||
FinishFun(FoldFun()) | |||
catch | |||
receiver_down -> ok | |||
end, | |||
{noreply, State}. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters