Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/branch-20c' into master
Browse files Browse the repository at this point in the history
* origin/branch-20c:
  MB-6284: don't touch index pausing API api if we don't need it
  MB-6284: bumped set_vbucket_state_timeout to infinity

Change-Id: I1f68da2be365f6b7a0df70837b4fa60d4ead9127
  • Loading branch information
Aliaksey Kandratsenka committed Aug 18, 2012
2 parents 844cfcb + 1d03653 commit b194d30
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
13 changes: 7 additions & 6 deletions src/capi_set_view_manager.erl
Expand Up @@ -319,10 +319,11 @@ apply_index_states(SetName, DDocId, Active, Passive, Cleanup,
Replica, ReplicaCleanup, PauseVBuckets, UnpauseVBuckets, UseReplicaIndex) ->

try
case ns_config_ets_dup:unreliable_read_key(index_pausing_disabled, false) of
true ->
ok;
PausingOn = cluster_compat_mode:is_index_pausing_on(),
case PausingOn of
false ->
ok;
true ->
ok = ?csv_call(mark_partitions_indexable,
[SetName, DDocId, UnpauseVBuckets])
end,
Expand All @@ -342,10 +343,10 @@ apply_index_states(SetName, DDocId, Active, Passive, Cleanup,
ok
end,

case ns_config_ets_dup:unreliable_read_key(index_pausing_disabled, false) of
true ->
ok;
case PausingOn of
false ->
ok;
true ->
ok = ?csv_call(mark_partitions_unindexable,
[SetName, DDocId, PauseVBuckets])
end
Expand Down
7 changes: 6 additions & 1 deletion src/cluster_compat_mode.erl
Expand Up @@ -21,7 +21,8 @@
is_cluster_20/0,
force_compat_version/1, un_force_compat_version/0,
consider_switching_compat_mode/0,
is_index_aware_rebalance_on/0]).
is_index_aware_rebalance_on/0,
is_index_pausing_on/0]).

%% NOTE: this is rpc:call-ed by mb_master
-export([supported_compat_version/0]).
Expand Down Expand Up @@ -54,6 +55,10 @@ is_index_aware_rebalance_on() ->
Disabled = ns_config_ets_dup:unreliable_read_key(index_aware_rebalance_disabled, false),
(not Disabled) andalso is_enabled([2, 0]).

is_index_pausing_on() ->
is_index_aware_rebalance_on() andalso
(not ns_config_ets_dup:unreliable_read_key(index_aware_rebalance_disabled, false)).

consider_switching_compat_mode() ->
Config = ns_config:get(),
CurrentVersion = ns_config:search(Config, cluster_compat_version, undefined),
Expand Down
2 changes: 1 addition & 1 deletion src/janitor_agent.erl
Expand Up @@ -26,7 +26,7 @@

-define(PREPARE_REBALANCE_TIMEOUT, ns_config_ets_dup:get_timeout(janitor_agent_prepare_rebalance, 30000)).

-define(SET_VBUCKET_STATE_TIMEOUT, ns_config_ets_dup:get_timeout(janitor_agent_set_vbucket_state, 60000)).
-define(SET_VBUCKET_STATE_TIMEOUT, infinity).

-define(GET_SRC_DST_REPLICATIONS_TIMEOUT, ns_config_ets_dup:get_timeout(janitor_agent_get_src_dst_replications, 30000)).

Expand Down

0 comments on commit b194d30

Please sign in to comment.