This is an automated email from the ASF dual-hosted git repository. chhsiao pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/mesos.git
commit 61eaef09d3df7c5aab9311b571f95a890bcf211b Author: Chun-Hung Hsiao <chhs...@mesosphere.io> AuthorDate: Tue Jun 11 11:33:18 2019 -0700 Added `reconciliation_interval_seconds` for storage resource providers. This new configuration option controls how frequent a storage resource provider reconciles existing volumes and storage pools against its CSI plugin to detect new or missing disk resources. Review: https://reviews.apache.org/r/71144 --- include/mesos/mesos.proto | 6 ++++++ include/mesos/v1/mesos.proto | 6 ++++++ src/Makefile.am | 1 + src/resource_provider/constants.hpp | 30 ++++++++++++++++++++++++++++++ 4 files changed, 43 insertions(+) diff --git a/include/mesos/mesos.proto b/include/mesos/mesos.proto index cb6d131..8fd838e 100644 --- a/include/mesos/mesos.proto +++ b/include/mesos/mesos.proto @@ -1148,6 +1148,12 @@ message ResourceProviderInfo { // Storage resource provider related information. message Storage { required CSIPluginInfo plugin = 1; + + // Amount of time to wait after the resource provider finishes reconciling + // existing volumes and storage pools against the CSI plugin to start the + // next reconciliation. A non-positive value means that no reconciliation + // will happen after startup. + optional double reconciliation_interval_seconds = 2; } optional Storage storage = 6; // EXPERIMENTAL. diff --git a/include/mesos/v1/mesos.proto b/include/mesos/v1/mesos.proto index 438c3fe..da19256 100644 --- a/include/mesos/v1/mesos.proto +++ b/include/mesos/v1/mesos.proto @@ -1136,6 +1136,12 @@ message ResourceProviderInfo { // Storage resource provider related information. message Storage { required CSIPluginInfo plugin = 1; + + // Amount of time to wait after the resource provider finishes reconciling + // existing volumes and storage pools against the CSI plugin to start the + // next reconciliation. A non-positive value means that no reconciliation + // will happen after startup. + optional double reconciliation_interval_seconds = 2; } optional Storage storage = 6; // EXPERIMENTAL. diff --git a/src/Makefile.am b/src/Makefile.am index f0a83a2..2164c60 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1178,6 +1178,7 @@ libmesos_no_3rdparty_la_SOURCES += \ oci/spec.cpp \ posix/rlimits.cpp \ posix/rlimits.hpp \ + resource_provider/constants.cpp \ resource_provider/daemon.cpp \ resource_provider/daemon.hpp \ resource_provider/detector.cpp \ diff --git a/src/resource_provider/constants.hpp b/src/resource_provider/constants.hpp new file mode 100644 index 0000000..218a9c9 --- /dev/null +++ b/src/resource_provider/constants.hpp @@ -0,0 +1,30 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef __RESOURCE_PROVIDER_CONSTANTS_HPP__ +#define __RESOURCE_PROVIDER_CONSTANTS_HPP__ + +#include <stout/duration.hpp> + +namespace mesos { +namespace resource_provider { + +constexpr Duration DEFAULT_STORAGE_RECONCILIATION_INTERVAL = Seconds(10); + +} // namespace resource_provider { +} // namespace mesos { + +#endif // __RESOURCE_PROVIDER_CONSTANTS_HPP__