You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by mz...@apache.org on 2019/07/01 21:20:39 UTC

[mesos] 01/04: Added master minimum capability `QUOTA_V2`.

This is an automated email from the ASF dual-hosted git repository.

mzhu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mesos.git

commit 0bc857d672189605f83acb7ef57bce89b141ba72
Author: Meng Zhu <mz...@mesosphere.io>
AuthorDate: Tue Jun 25 15:19:44 2019 -0700

    Added master minimum capability `QUOTA_V2`.
    
    This adds a new enum for the revamped quota feature
    in the master. When quota is configured in Mesos 1.9
    or higher, the quota configurations will be persisted
    into the `quota_configs` field in the registry. And
    the `QUOTA_V2` minimum capability will be added to the
    registry as well. This will prevent any master downgrades
    until `quota_configs` becomes empty. This can be done by
    setting the quota of the roles listed in `quota_configs`
    back to the default (no guarantees and no limits).
    
    Note, since at the moment of adding this patch, the master
    is not yet capable of handling the new quota API. The
    `capability` is not added to the `MASTER_CAPABILITIES`.
    That should be done later together with the patches that
    enables master for handling the new quota calls.
    
    Review: https://reviews.apache.org/r/70949
---
 docs/downgrades.md            | 30 ++++++++++++++++++++++++++++++
 include/mesos/mesos.proto     |  4 ++++
 src/common/protobuf_utils.hpp |  4 ++++
 3 files changed, 38 insertions(+)

diff --git a/docs/downgrades.md b/docs/downgrades.md
index 3807254..6c020e8 100644
--- a/docs/downgrades.md
+++ b/docs/downgrades.md
@@ -53,4 +53,34 @@ these minimum capabilities and remediation for downgrade errors.
     </ol>
   </td>
 </tr>
+
+<tr>
+  <td>
+    <code>QUOTA_V2</code>
+  </td>
+  <td>
+    This capability is required when quota is configured in Mesos 1.9 or
+    higher. When that happens, the newly configured quota will be persisted
+    in the <code>quota_configs</code> field in the registry which requires this
+    capability to decode.
+    <br/>
+    To remove this minimum capability requirement:
+    <ol>
+      <li>
+        Stop the master downgrade and return to the more recent version.
+      </li>
+      <li>
+        Use the <code>/registrar(id)/registry</code> endpoint to read the
+        registry content and identify roles listed under the
+        <code>quota_configs</code> field.
+      </li>
+      <li>
+        Reset those roles' quota back to default (no guarantees and no limits).
+        This will remove the roles from the <code>quota_configs</code> field.
+        Once <code>quota_configs</code> becomes empty, the capability
+        requirement will be removed.
+      </li>
+    </ol>
+  </td>
+</tr>
 </table>
diff --git a/include/mesos/mesos.proto b/include/mesos/mesos.proto
index 6869413..c4dd0de 100644
--- a/include/mesos/mesos.proto
+++ b/include/mesos/mesos.proto
@@ -924,6 +924,10 @@ message MasterInfo {
       // The master can drain or deactivate agents when requested
       // via operator APIs.
       AGENT_DRAINING = 2;
+
+      // The master can handle the new quota API, which supports setting
+      // limits separately from guarantees (introduced in Mesos 1.9).
+      QUOTA_V2 = 3;
     }
     optional Type type = 1;
   }
diff --git a/src/common/protobuf_utils.hpp b/src/common/protobuf_utils.hpp
index cf52ccd..f1d74ce 100644
--- a/src/common/protobuf_utils.hpp
+++ b/src/common/protobuf_utils.hpp
@@ -499,12 +499,16 @@ struct Capabilities
         case MasterInfo::Capability::AGENT_DRAINING:
           agentDraining = true;
           break;
+        case MasterInfo::Capability::QUOTA_V2:
+          quotaV2 = true;
+          break;
       }
     }
   }
 
   bool agentUpdate = false;
   bool agentDraining = false;
+  bool quotaV2 = false;
 };
 
 namespace event {