You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by ji...@apache.org on 2016/01/27 02:52:02 UTC

mesos git commit: Ignored MOUNT type disk for disk quota enforcement.

Repository: mesos
Updated Branches:
  refs/heads/master 85d4baa00 -> ab9927339


Ignored MOUNT type disk for disk quota enforcement.

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


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

Branch: refs/heads/master
Commit: ab9927339ad8c270ed273552644830f4d79990c9
Parents: 85d4baa
Author: Jie Yu <yu...@gmail.com>
Authored: Tue Jan 26 17:20:33 2016 -0800
Committer: Jie Yu <yu...@gmail.com>
Committed: Tue Jan 26 17:51:45 2016 -0800

----------------------------------------------------------------------
 .../containerizer/mesos/isolators/posix/disk.cpp | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/ab992733/src/slave/containerizer/mesos/isolators/posix/disk.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/isolators/posix/disk.cpp b/src/slave/containerizer/mesos/isolators/posix/disk.cpp
index 5ed9353..d5bf8c1 100644
--- a/src/slave/containerizer/mesos/isolators/posix/disk.cpp
+++ b/src/slave/containerizer/mesos/isolators/posix/disk.cpp
@@ -191,6 +191,10 @@ Future<Nothing> PosixDiskIsolatorProcess::update(
       }
     }
 
+    // TODO(jieyu): For persistent volumes, validate that there is
+    // only one Resource object associated with it. We could have
+    // multiple Resource objects associated with the sandbox because
+    // it might be a mix of reserved and unreserved resources.
     quotas[path] += resource;
   }
 
@@ -257,7 +261,20 @@ void PosixDiskIsolatorProcess::_collect(
     // Save the last disk usage.
     info->paths[path].lastUsage = future.get();
 
-    if (flags.enforce_container_disk_quota) {
+    // We need to ignore the quota enforcement check for MOUNT type
+    // disk resources because its quota will be enforced by the
+    // underlying filesystem.
+    bool isDiskSourceMount = false;
+    foreach (const Resource& resource, info->paths[path].quota) {
+      if (resource.has_disk() &&
+          resource.disk().has_source() &&
+          resource.disk().source().type() ==
+            Resource::DiskInfo::Source::MOUNT) {
+        isDiskSourceMount = true;
+      }
+    }
+
+    if (flags.enforce_container_disk_quota && !isDiskSourceMount) {
       Option<Bytes> quota = info->paths[path].quota.disk();
       CHECK_SOME(quota);