Added comments and made some renaming in SLRP. Review: https://reviews.apache.org/r/65974/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/fd49c4a9 Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/fd49c4a9 Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/fd49c4a9 Branch: refs/heads/master Commit: fd49c4a968b71045de686ded37aa539efa11fc19 Parents: f4345c1 Author: Chun-Hung Hsiao <chhs...@apache.org> Authored: Mon Apr 30 14:20:06 2018 -0700 Committer: Chun-Hung Hsiao <chhs...@mesosphere.io> Committed: Mon Apr 30 14:59:40 2018 -0700 ---------------------------------------------------------------------- src/resource_provider/storage/provider.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/mesos/blob/fd49c4a9/src/resource_provider/storage/provider.cpp ---------------------------------------------------------------------- diff --git a/src/resource_provider/storage/provider.cpp b/src/resource_provider/storage/provider.cpp index 8ca2d3a..8001ade 100644 --- a/src/resource_provider/storage/provider.cpp +++ b/src/resource_provider/storage/provider.cpp @@ -339,14 +339,21 @@ private: void initialize() override; void fatal(); + // The recover functions are responsible to recover the state of the + // resource provider and CSI volumes from checkpointed data. Future<Nothing> recover(); Future<Nothing> recoverServices(); Future<Nothing> recoverVolumes(); Future<Nothing> recoverResourceProviderState(); Future<Nothing> recoverProfiles(); + void doReliableRegistration(); + + // The reconcile functions are responsible to reconcile the state of + // the resource provider from the recovered state and other sources of + // truth, such as CSI plugin responses or the status update manager. Future<Nothing> reconcileResourceProviderState(); - Future<Nothing> reconcileStatusUpdates(); + Future<Nothing> reconcileOperationStatuses(); ResourceConversion reconcileResources( const Resources& checkpointed, const Resources& discovered); @@ -1083,7 +1090,7 @@ void StorageLocalResourceProviderProcess::doReliableRegistration() Future<Nothing> StorageLocalResourceProviderProcess::reconcileResourceProviderState() { - return reconcileStatusUpdates() + return reconcileOperationStatuses() .then(defer(self(), [=] { return collect(list<Future<Resources>>{listVolumes(), getCapacities()}) .then(defer(self(), [=](const list<Resources>& discovered) { @@ -1120,7 +1127,8 @@ StorageLocalResourceProviderProcess::reconcileResourceProviderState() } -Future<Nothing> StorageLocalResourceProviderProcess::reconcileStatusUpdates() +Future<Nothing> +StorageLocalResourceProviderProcess::reconcileOperationStatuses() { CHECK(info.has_id());