Skip to content

Commit

Permalink
MB-49765 Remove support for upgrading to 6.5
Browse files Browse the repository at this point in the history
The minimum supported release is 6.5 so there's no need for upgrade to
6.5 support.

Change-Id: I75272d385429dfb182190012c4b58cc99fd1ae36
Reviewed-on: https://review.couchbase.org/c/ns_server/+/166647
Well-Formed: Build Bot <build@couchbase.com>
Tested-by: Steve Watanabe <steve.watanabe@couchbase.com>
Reviewed-by: Timofey Barmin <timofey.barmin@couchbase.com>
  • Loading branch information
stevewatanabe committed Dec 3, 2021
1 parent c4ca754 commit f45baf2
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 55 deletions.
9 changes: 1 addition & 8 deletions src/auto_rebalance_settings.erl
Expand Up @@ -19,19 +19,12 @@
%% Retry rebalance after time period in seconds
-define(RETRY_AFTER_DEFAULT, 300).

-export([config_upgrade_to_65/0,
get_retry_rebalance/0,
-export([get_retry_rebalance/0,
set_retry_rebalance/1,
get_retry_after/1,
get_retry_max/1,
is_retry_enabled/0]).

config_upgrade_to_65() ->
Cfg = [{enabled, false},
{after_time_period, ?RETRY_AFTER_DEFAULT},
{max_attempts, ?RETRY_ATTEMPTS_DEFAULT}],
[{set, retry_rebalance, Cfg}].

get_retry_rebalance() ->
get_retry_rebalance(ns_config:latest()).

Expand Down
13 changes: 1 addition & 12 deletions src/menelaus_web_auto_failover.erl
Expand Up @@ -15,8 +15,7 @@
handle_settings_post/1,
handle_settings_reset_count/1,
get_failover_on_disk_issues/1,
config_check_can_abort_rebalance/0,
config_upgrade_to_65/1]).
config_check_can_abort_rebalance/0]).

-import(menelaus_util,
[reply/2,
Expand Down Expand Up @@ -106,16 +105,6 @@ get_failover_on_disk_issues(Config) ->
{Enabled, TimePeriod}
end.

config_upgrade_to_65(Config) ->
auto_failover:upgrade_cfg(
Config,
fun (Current) ->
CanAbortRebalance = cluster_compat_mode:is_enterprise(),
lists:keystore(?CAN_ABORT_REBALANCE_CONFIG_KEY, 1, Current,
{?CAN_ABORT_REBALANCE_CONFIG_KEY,
CanAbortRebalance})
end).

%% Internal Functions

validate_settings_auto_failover(Args, Config) ->
Expand Down
9 changes: 0 additions & 9 deletions src/menelaus_web_settings.erl
Expand Up @@ -50,7 +50,6 @@

handle_reset_ciphers_suites/1,

config_upgrade_to_65/1,
services_with_security_settings/0,
settings_stats_validators/0,
apply_stats_settings/1,
Expand Down Expand Up @@ -940,14 +939,6 @@ handle_reset_ciphers_suites(Req) ->
reset_per_service_cipher_suites(Req),
reply_json(Req, {[]}).

config_upgrade_to_65(Config) ->
case ns_config:search(Config, gotraceback) of
{value, <<"crash">>} ->
[{set, gotraceback, <<"single">>}];
_ ->
[]
end.

get_rebalance_moves_per_node() ->
ns_config:read_key_fast(rebalance_moves_per_node,
?DEFAULT_MAX_MOVES_PER_NODE).
Expand Down
10 changes: 0 additions & 10 deletions src/ns_bucket.erl
Expand Up @@ -109,7 +109,6 @@
buckets_with_data_on_this_node/0,
activate_bucket_data_on_this_node/1,
deactivate_bucket_data_on_this_node/1,
config_upgrade_to_65/1,
config_upgrade_to_66/1,
upgrade_to_chronicle/2,
chronicle_upgrade_to_NEO/1,
Expand Down Expand Up @@ -1418,15 +1417,6 @@ upgrade_buckets(Config, Fun) ->
{Name, BucketConfig} <-Buckets],
[{set, buckets, [{configs, NewBuckets}]}].

config_upgrade_to_65(Config) ->
MaxBuckets = case ns_config:search(Config, max_bucket_count) of
false ->
?MAX_BUCKETS_SUPPORTED;
{value, V} ->
erlang:max(V, ?MAX_BUCKETS_SUPPORTED)
end,
[{set, max_bucket_count, MaxBuckets}].

config_upgrade_to_66(Config) ->
upgrade_buckets(Config,
fun (_Name, BCfg) ->
Expand Down
8 changes: 0 additions & 8 deletions src/ns_online_config_upgrader.erl
Expand Up @@ -84,14 +84,6 @@ maybe_upgrade_to_chronicle(_, _) ->
%% Note: upgrade functions must ensure that they do not add entries to the
%% configuration which are already present.

upgrade(?VERSION_60, Config) ->
{?VERSION_65,
menelaus_web_auto_failover:config_upgrade_to_65(Config) ++
ns_bucket:config_upgrade_to_65(Config) ++
auto_rebalance_settings:config_upgrade_to_65() ++
query_settings_manager:config_upgrade_to_65(Config) ++
menelaus_web_settings:config_upgrade_to_65(Config)};

upgrade(?VERSION_65, Config) ->
{?VERSION_66,
menelaus_users:config_upgrade() ++
Expand Down
8 changes: 0 additions & 8 deletions src/query_settings_manager.erl
Expand Up @@ -22,7 +22,6 @@
get_from_config/3,
update/2,
config_default/0,
config_upgrade_to_65/1,
config_upgrade_to_70/1
]).

Expand Down Expand Up @@ -62,13 +61,6 @@ config_default() ->
default_settings(?VERSION_60),
dict:new(), known_settings(?VERSION_60))}.

config_upgrade_to_65(Config) ->
NewSettings = general_settings_defaults(?VERSION_65) --
general_settings_defaults(?VERSION_60),
json_settings_manager:upgrade_existing_key(
?MODULE, Config, [{generalSettings, NewSettings}],
known_settings(?VERSION_65)).

config_upgrade_to_70(Config) ->
NewSettings = general_settings_defaults(?VERSION_70) --
general_settings_defaults(?VERSION_65),
Expand Down

0 comments on commit f45baf2

Please sign in to comment.