You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by ya...@apache.org on 2017/10/26 19:05:05 UTC
mesos git commit: Logged the resources in DRF sorter CHECKs.
Repository: mesos
Updated Branches:
refs/heads/master c1efbca7f -> f26ffcee0
Logged the resources in DRF sorter CHECKs.
If calls to these checks fail, log related resources objects which
caused the failure.
Review: https://reviews.apache.org/r/63332/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/f26ffcee
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/f26ffcee
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/f26ffcee
Branch: refs/heads/master
Commit: f26ffcee0a359a644968feca1ec91243401f589a
Parents: c1efbca
Author: Zhitao Li <zh...@gmail.com>
Authored: Thu Oct 26 12:03:47 2017 -0700
Committer: Jiang Yan Xu <xu...@apple.com>
Committed: Thu Oct 26 12:03:47 2017 -0700
----------------------------------------------------------------------
src/master/allocator/sorter/drf/sorter.hpp | 17 +++++++++++++----
1 file changed, 13 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/f26ffcee/src/master/allocator/sorter/drf/sorter.hpp
----------------------------------------------------------------------
diff --git a/src/master/allocator/sorter/drf/sorter.hpp b/src/master/allocator/sorter/drf/sorter.hpp
index 77e52de..1a7681c 100644
--- a/src/master/allocator/sorter/drf/sorter.hpp
+++ b/src/master/allocator/sorter/drf/sorter.hpp
@@ -346,7 +346,9 @@ struct DRFSorter::Node
void subtract(const SlaveID& slaveId, const Resources& toRemove)
{
CHECK(resources.contains(slaveId));
- CHECK(resources.at(slaveId).contains(toRemove));
+ CHECK(resources.at(slaveId).contains(toRemove))
+ << "Resources " << resources.at(slaveId) << " at agent " << slaveId
+ << " does not contain " << toRemove;
resources[slaveId] -= toRemove;
@@ -364,7 +366,9 @@ struct DRFSorter::Node
totals[resource.name()] -= resource.scalar();
}
- CHECK(scalarQuantities.contains(quantitiesToRemove));
+ CHECK(scalarQuantities.contains(quantitiesToRemove))
+ << scalarQuantities << " does not contain " << quantitiesToRemove;
+
scalarQuantities -= quantitiesToRemove;
if (resources[slaveId].empty()) {
@@ -382,8 +386,13 @@ struct DRFSorter::Node
const Resources newAllocationQuantity =
newAllocation.createStrippedScalarQuantity();
- CHECK(resources[slaveId].contains(oldAllocation));
- CHECK(scalarQuantities.contains(oldAllocationQuantity));
+ CHECK(resources.contains(slaveId));
+ CHECK(resources[slaveId].contains(oldAllocation))
+ << "Resources " << resources[slaveId] << " at agent " << slaveId
+ << " does not contain " << oldAllocation;
+
+ CHECK(scalarQuantities.contains(oldAllocationQuantity))
+ << scalarQuantities << " does not contain " << oldAllocationQuantity;
resources[slaveId] -= oldAllocation;
resources[slaveId] += newAllocation;