kudu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject [2/2] incubator-kudu git commit: master: fix initialization race with consensus RPCs
Date Thu, 14 Jul 2016 20:56:12 GMT
master: fix initialization race with consensus RPCs

The master initialization order is such that the various RPC services are
brought up before the catalog manager. With multiple masters, it's possible
for a master to receive a consensus-related RPC at this delicate time,
causing a crash.

I spent some time trying to unravel this mess but it proved too thorny, so I
relaxed the CHECK instead. The other masters appear to cope with this error.

There's no explicit test here, but this path is exercised by a stress test
in a follow-on patch.

Change-Id: I3d1276dd4d3c2f555d63d97d7a16d54181a352b7
Reviewed-on: http://gerrit.cloudera.org:8080/3605
Reviewed-by: Dan Burkert <dan@cloudera.com>
Tested-by: Kudu Jenkins


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

Branch: refs/heads/master
Commit: 2525ad094234e6bc901b8bc544801ca00e8f411e
Parents: 37f1604
Author: Adar Dembo <adar@cloudera.com>
Authored: Fri Jul 8 18:52:38 2016 -0700
Committer: Adar Dembo <adar@cloudera.com>
Committed: Thu Jul 14 20:55:22 2016 +0000

----------------------------------------------------------------------
 src/kudu/master/catalog_manager.cc | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/2525ad09/src/kudu/master/catalog_manager.cc
----------------------------------------------------------------------
diff --git a/src/kudu/master/catalog_manager.cc b/src/kudu/master/catalog_manager.cc
index 819b3a3..07d8487 100644
--- a/src/kudu/master/catalog_manager.cc
+++ b/src/kudu/master/catalog_manager.cc
@@ -1764,7 +1764,9 @@ Status CatalogManager::GetTabletPeer(const string& tablet_id,
   // Note: CatalogManager has only one table, 'sys_catalog', with only
   // one tablet.
   shared_lock<LockType> l(lock_);
-  CHECK(sys_catalog_.get() != nullptr) << "sys_catalog_ must be initialized!";
+  if (!sys_catalog_) {
+    return Status::ServiceUnavailable("Systable not yet initialized");
+  }
   if (sys_catalog_->tablet_id() == tablet_id) {
     *tablet_peer = sys_catalog_->tablet_peer();
   } else {


Mime
View raw message