kudu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mpe...@apache.org
Subject kudu git commit: Actually support downgrade to version that has LocalConsensus
Date Sat, 27 Aug 2016 00:30:19 GMT
Repository: kudu
Updated Branches:
  refs/heads/master db6d22da4 -> 25a66cd27


Actually support downgrade to version that has LocalConsensus

Commit 74210b2546df9fd5dec7bb926eeb524362d2da90 attempted to support
downgrade from 0.10.x to 0.9.x however there is specific validation in
VerifyRaftConfig() in Kudu 0.9.x that requires the optional field
"local" to be set (checked using has_local()). So we must not rely on
the default, rather, we must always set that field.

This patch was manually tested as follows:

A 3-way replicated table was created in 0.10.0-RC1 plus this patch,
using a single master and 3 tablet servers. The services were killed,
then restarted using 0.9.1 binaries.

Change-Id: Icded76c6400b4802581671e2e41efb74a47c5ec4
Reviewed-on: http://gerrit.cloudera.org:8080/4059
Tested-by: Kudu Jenkins
Reviewed-by: Dinesh Bhat <dinesh@cloudera.com>
Reviewed-by: Adar Dembo <adar@cloudera.com>


Project: http://git-wip-us.apache.org/repos/asf/kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/kudu/commit/25a66cd2
Tree: http://git-wip-us.apache.org/repos/asf/kudu/tree/25a66cd2
Diff: http://git-wip-us.apache.org/repos/asf/kudu/diff/25a66cd2

Branch: refs/heads/master
Commit: 25a66cd27680bcc07a52783d18dc0b5be5ac1a38
Parents: db6d22d
Author: Mike Percy <mpercy@apache.org>
Authored: Fri Aug 19 01:10:02 2016 -0600
Committer: Mike Percy <mpercy@apache.org>
Committed: Sat Aug 27 00:27:59 2016 +0000

----------------------------------------------------------------------
 src/kudu/master/catalog_manager.cc | 5 +++--
 src/kudu/master/sys_catalog.cc     | 1 +
 2 files changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kudu/blob/25a66cd2/src/kudu/master/catalog_manager.cc
----------------------------------------------------------------------
diff --git a/src/kudu/master/catalog_manager.cc b/src/kudu/master/catalog_manager.cc
index 2bc710e..7730ea6 100644
--- a/src/kudu/master/catalog_manager.cc
+++ b/src/kudu/master/catalog_manager.cc
@@ -3174,8 +3174,9 @@ Status CatalogManager::SelectReplicasForTablet(const TSDescriptorVector&
ts_desc
   consensus::RaftConfigPB *config = cstate->mutable_config();
 
   // Maintain ability to downgrade Kudu to a version with LocalConsensus.
-  if (nreplicas > 1) {
-    // Defaults to true in old versions of Kudu.
+  if (nreplicas == 1) {
+    config->set_obsolete_local(true);
+  } else {
     config->set_obsolete_local(false);
   }
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/25a66cd2/src/kudu/master/sys_catalog.cc
----------------------------------------------------------------------
diff --git a/src/kudu/master/sys_catalog.cc b/src/kudu/master/sys_catalog.cc
index 02af8c0..17450ac 100644
--- a/src/kudu/master/sys_catalog.cc
+++ b/src/kudu/master/sys_catalog.cc
@@ -180,6 +180,7 @@ Status SysCatalogTable::CreateNew(FsManager *fs_manager) {
     RETURN_NOT_OK_PREPEND(CreateDistributedConfig(master_->opts(), &config),
                           "Failed to create new distributed Raft config");
   } else {
+    config.set_obsolete_local(true);
     config.set_opid_index(consensus::kInvalidOpIdIndex);
     RaftPeerPB* peer = config.add_peers();
     peer->set_permanent_uuid(fs_manager->uuid());


Mime
View raw message