From f2174897451428b23c7e27f683e33f85e15e645b Mon Sep 17 00:00:00 2001 From: Brian Sparrow Date: Fri, 3 Mar 2017 18:23:15 -0500 Subject: [PATCH 1/3] Bump riak_kv to 2.1.7 --- rebar.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rebar.config b/rebar.config index 238465d3..3ec44cdf 100644 --- a/rebar.config +++ b/rebar.config @@ -11,7 +11,7 @@ {deps, [ {kvc, ".*", {git, "git://github.com/etrepum/kvc.git", {tag, "v1.5.0"}}}, - {riak_kv, ".*", {git, "git://github.com/basho/riak_kv.git", {tag, "2.1.6"}}}, + {riak_kv, ".*", {git, "git://github.com/basho/riak_kv.git", {tag, "2.1.7"}}}, {ibrowse, "4.0.2", {git, "git://github.com/cmullaparthi/ibrowse.git", {tag, "v4.0.2"}}}, {fuse, "2.1.0", {git, "git@github.com:jlouis/fuse.git", {tag, "v2.1.0"}}}, {riakc, ".*", {git, "git://github.com/basho/riak-erlang-client", {branch, "develop-2.2"}}} From da4a79c68adfddff068f772f60dda2fe4048203d Mon Sep 17 00:00:00 2001 From: Brett Hazen Date: Sun, 5 Mar 2017 21:49:41 -0700 Subject: [PATCH 2/3] Replace lts version with legacy --- riak_test/yz_solr_upgrade_downgrade.erl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/riak_test/yz_solr_upgrade_downgrade.erl b/riak_test/yz_solr_upgrade_downgrade.erl index 73a3cecd..50d8628f 100644 --- a/riak_test/yz_solr_upgrade_downgrade.erl +++ b/riak_test/yz_solr_upgrade_downgrade.erl @@ -123,11 +123,11 @@ confirm() -> setup_cluster() -> %% - %% Build a "previous" cluster using the configuration defined above + %% Build a "legacy" cluster using the configuration defined above %% Cluster = rt:build_cluster(lists:duplicate( ?CLUSTER_SIZE, - {lts, ?CONFIG} + {legacy, ?CONFIG} )), %% %% Create all the indices, each of which is associated its own bucket type @@ -251,7 +251,7 @@ verify_downgrade(Cluster) -> NewConfig = augment_config(yokozuna, solr_jmx_port, 44405, ?CONFIG), DowngradeData = ets:new(downgrade_data, []), yz_rt:rolling_upgrade( - Node1, lts, NewConfig, [riak_kv], + Node1, legacy, NewConfig, [riak_kv], fun(Params) -> ets:insert(DowngradeData, {params, Params}), downgrade_yz(Params) From b53d999529626301c36fa3efa22b2b0165217556 Mon Sep 17 00:00:00 2001 From: Fred Dushin Date: Tue, 14 Mar 2017 16:30:28 -0400 Subject: [PATCH 3/3] Added handling for upgrades from 2.0.8 and later releases, which has a minor change to the default solrconfig.xml, as well as fixing a regression in the rolling upgrade functionality in the upgrade/downgrade riak test (#732) * Added handling for upgrades from 2.0.8 and later releases, which has a minor change to the default solrconfig.xml, as well as fixing a regression in the rolling upgrade functionality in the upgrade/downgrade riak test --- riak_test/yz_rt.erl | 20 +++++++++++++++----- src/yz_solr_proc.erl | 18 +++++++++++++----- 2 files changed, 28 insertions(+), 10 deletions(-) diff --git a/riak_test/yz_rt.erl b/riak_test/yz_rt.erl index a068d60e..c5d26e80 100644 --- a/riak_test/yz_rt.erl +++ b/riak_test/yz_rt.erl @@ -95,6 +95,7 @@ riak_pb/1, rolling_upgrade/2, rolling_upgrade/4, + rolling_upgrade/5, run_bb/2, schema_url/2, search/4, @@ -864,13 +865,22 @@ store_schema(PBConn, Name, Raw) -> -spec rolling_upgrade([node()], current | previous | legacy) -> ok. rolling_upgrade(Cluster, Version) -> rolling_upgrade(Cluster, Version, same, [riak_kv, yokozuna]). --spec rolling_upgrade([node()], current | previous | legacy, props() | same, [atom()]) -> ok. -rolling_upgrade(Cluster, Version, UpgradeConfig, WaitForServices) when is_list(Cluster) -> + +rolling_upgrade(Cluster, Version, UpgradeConfig, WaitForServices) -> + rolling_upgrade(Cluster, Version, UpgradeConfig, WaitForServices, fun rt:no_op/1). + +-spec rolling_upgrade(cluster() | node(), + current | previous | legacy, + UpgradeConfig :: props(), + WaitForServices :: [atom()]) -> ok. +rolling_upgrade(Cluster, Version, UpgradeConfig, WaitForServices, UpgradeCallabck) + when is_list(Cluster) -> lager:info("Perform rolling upgrade on cluster ~p", [Cluster]), - [rolling_upgrade(Node, Version, UpgradeConfig, WaitForServices) || Node <- Cluster], + [rolling_upgrade(Node, Version, UpgradeConfig, WaitForServices, UpgradeCallabck) + || Node <- Cluster], ok; -rolling_upgrade(Node, Version, UpgradeConfig, WaitForServices) -> - rt:upgrade(Node, Version, UpgradeConfig), +rolling_upgrade(Node, Version, UpgradeConfig, WaitForServices, UpgradeCallabck) -> + rt:upgrade(Node, Version, UpgradeConfig, UpgradeCallabck), [rt:wait_for_service(Node, Service) || Service <- WaitForServices], ok. diff --git a/src/yz_solr_proc.erl b/src/yz_solr_proc.erl index a0616a8b..4b5899f3 100644 --- a/src/yz_solr_proc.erl +++ b/src/yz_solr_proc.erl @@ -55,6 +55,7 @@ -define(YZ_DEFAULT_SOLR_JVM_OPTS, ""). -define(SOLRCONFIG_2_0_HASH, 64816669). +-define(SOLRCONFIG_2_0_8_HASH, 7665368). -define(LUCENE_MATCH_4_7_VERSION, "4.7"). -define(LUCENE_MATCH_4_10_4_VERSION, "4.10.4"). @@ -386,16 +387,23 @@ check_solr_index_versions(YZRootDir) -> check_index_solrconfig(SolrConfigIndexPath, DefaultSolrConfigPath, DefaultSolrConfigHash) -> case hash_file_contents(SolrConfigIndexPath) of DefaultSolrConfigHash -> - ok; + lager:debug("Solr config ~s appears to be up to date.", [SolrConfigIndexPath]); ?SOLRCONFIG_2_0_HASH -> - yz_misc:copy_files([DefaultSolrConfigPath], filename:dirname(SolrConfigIndexPath)), - lager:info( - "Upgraded ~s to the latest version.", [SolrConfigIndexPath] - ); + upgrade_solr_config(SolrConfigIndexPath, DefaultSolrConfigPath, "2.0"); + %% NB. Riak 2.0.8 introduced a small change to solrconfig.xml + ?SOLRCONFIG_2_0_8_HASH -> + upgrade_solr_config(SolrConfigIndexPath, DefaultSolrConfigPath, "2.0.8"); _ -> check_index_solrconfig_version(SolrConfigIndexPath) end. +-spec upgrade_solr_config(path(), path(), string()) -> ok. +upgrade_solr_config(SolrConfigIndexPath, DefaultSolrConfigPath, Version) -> + yz_misc:copy_files([DefaultSolrConfigPath], filename:dirname(SolrConfigIndexPath)), + lager:info( + "Upgraded ~s from ~s (or higher) to the latest version.", [SolrConfigIndexPath, Version] + ). + -spec check_index_solrconfig_version(path()) -> ok. check_index_solrconfig_version(SolrConfigIndexPath) -> case get_lucene_match_version(SolrConfigIndexPath) of