mesos-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bmah...@apache.org
Subject [2/3] mesos git commit: Added CHECKs to prevent accidental overwrite of slaves.unreachable.
Date Tue, 09 Jan 2018 02:47:37 GMT
Added CHECKs to prevent accidental overwrite of slaves.unreachable.

In these cases, there should not be a previous entry within the
unreachable agents map.

Review: https://reviews.apache.org/r/64928


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/45a2a1de
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/45a2a1de
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/45a2a1de

Branch: refs/heads/master
Commit: 45a2a1defba6883ad097c5163c9c9dd868671028
Parents: c398373
Author: Benjamin Mahler <bmahler@apache.org>
Authored: Wed Jan 3 14:18:36 2018 -0800
Committer: Benjamin Mahler <bmahler@apache.org>
Committed: Mon Jan 8 18:34:51 2018 -0800

----------------------------------------------------------------------
 src/master/master.cpp | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/45a2a1de/src/master/master.cpp
----------------------------------------------------------------------
diff --git a/src/master/master.cpp b/src/master/master.cpp
index 1d93c89..bac3a9e 100644
--- a/src/master/master.cpp
+++ b/src/master/master.cpp
@@ -1713,6 +1713,7 @@ Future<Nothing> Master::_recover(const Registry& registry)
 
   foreach (const Registry::UnreachableSlave& unreachable,
            registry.unreachable().slaves()) {
+    CHECK(!slaves.unreachable.contains(unreachable.id()));
     slaves.unreachable[unreachable.id()] = unreachable.timestamp();
   }
 
@@ -2111,6 +2112,7 @@ void Master::_markUnreachableAfterFailover(
   ++metrics->slave_removals_reason_unhealthy;
   ++metrics->recovery_slave_removals;
 
+  CHECK(!slaves.unreachable.contains(slaveInfo.id()));
   slaves.unreachable[slaveInfo.id()] = unreachableTime;
 
   sendSlaveLost(slaveInfo);
@@ -8287,6 +8289,7 @@ void Master::_markUnreachable(
   ++metrics->slave_removals;
   ++metrics->slave_removals_reason_unhealthy;
 
+  CHECK(!slaves.unreachable.contains(slave->id));
   slaves.unreachable[slave->id] = unreachableTime;
 
   __removeSlave(slave, message, unreachableTime);


Mime
View raw message