Repository: mesos
Updated Branches:
  refs/heads/master 9ecfb4aec -> 495988723


Added some deduplication logic to `Master::updateOperation`.

This patch adds some logic to deduplicate the status updates that are
added to `Operation::statuses`. The logic is similar to the handling
of task status updates, but we should revisit it in MESOS-8441.

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


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

Branch: refs/heads/master
Commit: 433a7c8acffeba57e9ffc6f395a6cb31151edfc7
Parents: 9ecfb4a
Author: Gaston Kleiman <gas...@mesosphere.io>
Authored: Fri Jan 12 18:56:17 2018 -0800
Committer: Greg Mann <gregorywm...@gmail.com>
Committed: Sat Jan 13 08:47:28 2018 -0800

----------------------------------------------------------------------
 src/master/master.cpp | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/433a7c8a/src/master/master.cpp
----------------------------------------------------------------------
diff --git a/src/master/master.cpp b/src/master/master.cpp
index 341881b..465336d 100644
--- a/src/master/master.cpp
+++ b/src/master/master.cpp
@@ -10352,7 +10352,13 @@ void Master::updateOperation(
     operation->mutable_latest_status()->CopyFrom(status);
   }
 
-  operation->add_statuses()->CopyFrom(status);
+  // TODO(gkleiman): Revisit the de-duplication logic (MESOS-8441) - if two
+  // different terminal statuses arrive, we could end up with different states
+  // in `latest_status` and the front of statuses list.
+  if (operation->statuses().empty() ||
+      *(operation->statuses().rbegin()) != status) {
+    operation->add_statuses()->CopyFrom(status);
+  }
 
   if (!terminated) {
     return;

Reply via email to