Skip to content

Remove dependency on plan field  #344

@timcharper

Description

@timcharper

Hello!

Marathon is removing some fields from the event stream as they were problematic in larger clusters. Specifically, the fields plan.original, and plan.target.

Original (as rendered by default in Marathon 1.6.x)

{
  "id": "test-deployment",
  "plan": {
    "id": "42f3b763-ba19-45c6-9a68-207edfc78bc0",
    "original": {"id": "/", "apps": [], "pods": [], "groups": [], "dependencies": [], "version": "2018-06-08T20:24:32.765Z"},
    "target": {"id": "/", "apps": [{"id": "/app", "backoffFactor": 1.15, "backoffSeconds": 1, "cmd": "sleep", "cpus": 1, "disk": 0, "executor": "", "instances": 1, "labels": {}, "maxLaunchDelaySeconds": 3600, "mem": 128, "gpus": 0, "networks": [{"mode": "host"}], "portDefinitions": [], "requirePorts": false, "upgradeStrategy": {"maximumOverCapacity": 1, "minimumHealthCapacity": 1}, "version": "2018-06-08T20:24:32.727Z", "killSelection": "YOUNGEST_FIRST", "unreachableStrategy": {"inactiveAfterSeconds": 0, "expungeAfterSeconds": 0}}], "pods": [], "groups": [], "dependencies": [], "version": "2018-06-08T20:24:32.921Z"},
    "steps": [
      {"actions": [{"action": "StartApplication", "app": "/app"}]},
      {"actions": [{"action": "ScaleApplication", "app": "/app"}]}
    ],
    "version": "2018-06-08T20:24:33.093Z"
  },
  "eventType": "deployment_success",
  "timestamp": "2018-01-01T00:00:00.000Z"
}

Newer, lighter weight format:

{
  "id": "test-deployment",
  "plan": {
    "id": "42f3b763-ba19-45c6-9a68-207edfc78bc0",
    "steps": [
      {"actions": [{"action": "StartApplication", "app": "/app"}]},
      {"actions": [{"action": "ScaleApplication", "app": "/app"}]}
    ],
    "version": "2018-06-08T20:24:33.093Z"
  },
  "eventType": "deployment_success",
  "timestamp": "2018-06-08T20:24:33.673Z"
}

A diff, for more clarity:

--- heavy	2018-06-08 14:33:17.000000000 -0600
+++ light	2018-06-08 14:33:19.000000000 -0600
@@ -2,8 +2,6 @@
   "id": "test-deployment",
   "plan": {
     "id": "42f3b763-ba19-45c6-9a68-207edfc78bc0",
-    "original": {"id": "/", "apps": [], "pods": [], "groups": [], "dependencies": [], "version": "2018-06-08T20:24:32.765Z"},
-    "target": {"id": "/", "apps": [{"id": "/app", "backoffFactor": 1.15, "backoffSeconds": 1, "cmd": "sleep", "cpus": 1, "disk": 0, "executor": "", "instances": 1, "labels": {}, "maxLaunchDelaySeconds": 3600, "mem": 128, "gpus": 0, "networks": [{"mode": "host"}], "portDefinitions": [], "requirePorts": false, "upgradeStrategy": {"maximumOverCapacity": 1, "minimumHealthCapacity": 1}, "version": "2018-06-08T20:24:32.727Z", "killSelection": "YOUNGEST_FIRST", "unreachableStrategy": {"inactiveAfterSeconds": 0, "expungeAfterSeconds": 0}}], "pods": [], "groups": [], "dependencies": [], "version": "2018-06-08T20:24:32.921Z"},
     "steps": [
       {"actions": [{"action": "StartApplication", "app": "/app"}]},
       {"actions": [{"action": "ScaleApplication", "app": "/app"}]}

Currently, the latter format can be rendered in the latest stable release of Marathon 1.6.x by passing "?plan-format=light". In Marathon 1.7.x, the light format will become the default, although the prior format will be continued to be supported for a release longer via the flag --deprecated_features=api_heavy_events. In Marathon 1.8.x, support for the heavier events will be completely removed.

For more details, see the current changelog item: https://github.com/mesosphere/marathon/blob/8312640a16c70da8f205649174b69448a1cce755/changelog.md#v2events

What can be done to minimize the impact of this change to integrations at large? Are you aware of any strong motivation for the existence of the fields plan.original and plan.target ? These events became too large in Marathon instances with 4,000+ apps to the point that the event stream became non-functional.

https://github.com/gambol99/go-marathon/blob/master/events.go#L279

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions