{"action":"created","comment":{"url":"https://api.github.com/repos/mesosphere/marathon/pulls/comments/235228786","pull_request_review_id":177047060,"id":235228786,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzNTIyODc4Ng==","diff_hunk":"@@ -56,13 +57,16 @@ private[marathon] class InstanceUpdateOpResolver(clock: Clock) extends StrictLog\n         updateExistingInstance(maybeInstance, op.instanceId)(updater.reservationTimeout(_, clock.now()))\n \n       case op: GoalChange =>","path":"src/main/scala/mesosphere/marathon/core/instance/update/InstanceUpdateOpResolver.scala","position":11,"original_position":11,"commit_id":"bebb78d19fe2e905b5e4c9051aa06b96d0c19a2e","original_commit_id":"4ca85ffab1fd9ef0dea08c3884b6c4903e6b7e86","user":{"login":"alenkacz","id":264608,"node_id":"MDQ6VXNlcjI2NDYwOA==","avatar_url":"https://avatars1.githubusercontent.com/u/264608?v=4","gravatar_id":"","url":"https://api.github.com/users/alenkacz","html_url":"https://github.com/alenkacz","followers_url":"https://api.github.com/users/alenkacz/followers","following_url":"https://api.github.com/users/alenkacz/following{/other_user}","gists_url":"https://api.github.com/users/alenkacz/gists{/gist_id}","starred_url":"https://api.github.com/users/alenkacz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alenkacz/subscriptions","organizations_url":"https://api.github.com/users/alenkacz/orgs","repos_url":"https://api.github.com/users/alenkacz/repos","events_url":"https://api.github.com/users/alenkacz/events{/privacy}","received_events_url":"https://api.github.com/users/alenkacz/received_events","type":"User","site_admin":false},"body":"I will do that on master... This was not introduced in this PR","created_at":"2018-11-21T01:38:33Z","updated_at":"2018-11-21T01:38:33Z","html_url":"https://github.com/mesosphere/marathon/pull/6616#discussion_r235228786","pull_request_url":"https://api.github.com/repos/mesosphere/marathon/pulls/6616","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/mesosphere/marathon/pulls/comments/235228786"},"html":{"href":"https://github.com/mesosphere/marathon/pull/6616#discussion_r235228786"},"pull_request":{"href":"https://api.github.com/repos/mesosphere/marathon/pulls/6616"}},"in_reply_to_id":235101954},"pull_request":{"url":"https://api.github.com/repos/mesosphere/marathon/pulls/6616","id":222737202,"node_id":"MDExOlB1bGxSZXF1ZXN0MjIyNzM3MjAy","html_url":"https://github.com/mesosphere/marathon/pull/6616","diff_url":"https://github.com/mesosphere/marathon/pull/6616.diff","patch_url":"https://github.com/mesosphere/marathon/pull/6616.patch","issue_url":"https://api.github.com/repos/mesosphere/marathon/issues/6616","number":6616,"state":"open","locked":false,"title":"Kill instances via goal and keep stable Ids","user":{"login":"meichstedt","id":414354,"node_id":"MDQ6VXNlcjQxNDM1NA==","avatar_url":"https://avatars2.githubusercontent.com/u/414354?v=4","gravatar_id":"","url":"https://api.github.com/users/meichstedt","html_url":"https://github.com/meichstedt","followers_url":"https://api.github.com/users/meichstedt/followers","following_url":"https://api.github.com/users/meichstedt/following{/other_user}","gists_url":"https://api.github.com/users/meichstedt/gists{/gist_id}","starred_url":"https://api.github.com/users/meichstedt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/meichstedt/subscriptions","organizations_url":"https://api.github.com/users/meichstedt/orgs","repos_url":"https://api.github.com/users/meichstedt/repos","events_url":"https://api.github.com/users/meichstedt/events{/privacy}","received_events_url":"https://api.github.com/users/meichstedt/received_events","type":"User","site_admin":false},"body":"This PR addresses several JIRAs. The reason why they are kept together in one PR is following:\r\n- even though it is potentially several issues, the PR is still reasonably big to allow reviews\r\n- separating the work based on the JIRAs would mean that we would have to land them separately and introduce some temporary “hacks” to make that separate PRs stable. Including stable ids just made some synchronization issues easier to address\r\n\r\n# What’s included:\r\n\r\n## Kill instances based on goal\r\nThis is the main issue addressed by this PR. Before we had to call everywhere in orchestration code the following:\r\n- setGoal\r\n- kill\r\n\r\nThe killing logic is now hidden inside scheduler so from orchestrator perspective you only set the goal to decommission and the killing will happen as a result of that.\r\nThat means that The KillServiceActor now listens to InstanceGoalChangeEvent and will add instances to its internal queue when appropriate.\r\nAs a result we had to introduced a way to wait for terminal instances. That’s done by `KillService.watchForKilledInstances`. We should potentially improve this logic in the future.\r\n\r\nJIRA Issues: MARATHON-8296, MARATHON-8225\r\n\r\n## Only expunge instances when they should not be replaced\r\n\r\nUntil now, Marathon expunged instances once all of their tasks ended up in a terminal state, and eventually launched replacements as a result of those instances being expunged.\r\nThis commit adjusts this behavior. Instances will now only be expunged from state when their goal is to be decommissioned and all their tasks are in a terminal state. If their goal is still Running, they will be considered to be scheduled, and used to launch replacement tasks.\r\n\r\nThis means that instanceIds are now stable for as long as an instance shall be kept running. New instances will be created only when replacing unreachable instances, and when replacing instances with new versions. Similar to the way we handle taskIds for stateful services, tasks of stateless services will now also provide an incarnation count, appended to the taskId. The first task created for an instance will be the .1, and subsequent replacements will increment that incarnation counter.\r\nWhen killing an instance using the wipe=true flag, its goal will be set to decommissioned, and it will eventually be expunged when all tasks are terminal. Note that as long as its tasks are e.g. unreachable, it will not be expunged until they are reported terminal (GONE, GONE_BY_OPERATOR, or UNKNOWN).\r\n\r\nWhen killing instances without the wipe=true or scale=true flags, Marathon will only issue kill requests to Mesos, but keep the current goal and will therefore launch replacements that are still associated with the existing instance.\r\n\r\nJIRA Issues: MARATHON-8429, MARATHON-8373, MARATHON-8140\r\n\r\nNotes: Also, I'd like to figure out whether we want to immediately expunge instances when using wipe=true, or whether we should rather set the goal to Decommissioned, and only force expunge when they turn out to be unkillable – either because Mesos doesn't send terminal status updates, or because the tasks are unreachable and user's want them to vanish from internal state.\r\n","created_at":"2018-10-14T19:24:30Z","updated_at":"2018-11-21T01:38:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"33df4c60a0e8b315293d36ee36c606b8a2245cbd","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/mesosphere/marathon/pulls/6616/commits","review_comments_url":"https://api.github.com/repos/mesosphere/marathon/pulls/6616/comments","review_comment_url":"https://api.github.com/repos/mesosphere/marathon/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mesosphere/marathon/issues/6616/comments","statuses_url":"https://api.github.com/repos/mesosphere/marathon/statuses/bebb78d19fe2e905b5e4c9051aa06b96d0c19a2e","head":{"label":"mesosphere:me/kill-instances-via-goal","ref":"me/kill-instances-via-goal","sha":"bebb78d19fe2e905b5e4c9051aa06b96d0c19a2e","user":{"login":"mesosphere","id":3458585,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM0NTg1ODU=","avatar_url":"https://avatars0.githubusercontent.com/u/3458585?v=4","gravatar_id":"","url":"https://api.github.com/users/mesosphere","html_url":"https://github.com/mesosphere","followers_url":"https://api.github.com/users/mesosphere/followers","following_url":"https://api.github.com/users/mesosphere/following{/other_user}","gists_url":"https://api.github.com/users/mesosphere/gists{/gist_id}","starred_url":"https://api.github.com/users/mesosphere/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mesosphere/subscriptions","organizations_url":"https://api.github.com/users/mesosphere/orgs","repos_url":"https://api.github.com/users/mesosphere/repos","events_url":"https://api.github.com/users/mesosphere/events{/privacy}","received_events_url":"https://api.github.com/users/mesosphere/received_events","type":"Organization","site_admin":false},"repo":{"id":10941409,"node_id":"MDEwOlJlcG9zaXRvcnkxMDk0MTQwOQ==","name":"marathon","full_name":"mesosphere/marathon","private":false,"owner":{"login":"mesosphere","id":3458585,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM0NTg1ODU=","avatar_url":"https://avatars0.githubusercontent.com/u/3458585?v=4","gravatar_id":"","url":"https://api.github.com/users/mesosphere","html_url":"https://github.com/mesosphere","followers_url":"https://api.github.com/users/mesosphere/followers","following_url":"https://api.github.com/users/mesosphere/following{/other_user}","gists_url":"https://api.github.com/users/mesosphere/gists{/gist_id}","starred_url":"https://api.github.com/users/mesosphere/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mesosphere/subscriptions","organizations_url":"https://api.github.com/users/mesosphere/orgs","repos_url":"https://api.github.com/users/mesosphere/repos","events_url":"https://api.github.com/users/mesosphere/events{/privacy}","received_events_url":"https://api.github.com/users/mesosphere/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/mesosphere/marathon","description":"Deploy and manage containers (including Docker) on top of Apache Mesos at scale.","fork":false,"url":"https://api.github.com/repos/mesosphere/marathon","forks_url":"https://api.github.com/repos/mesosphere/marathon/forks","keys_url":"https://api.github.com/repos/mesosphere/marathon/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mesosphere/marathon/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mesosphere/marathon/teams","hooks_url":"https://api.github.com/repos/mesosphere/marathon/hooks","issue_events_url":"https://api.github.com/repos/mesosphere/marathon/issues/events{/number}","events_url":"https://api.github.com/repos/mesosphere/marathon/events","assignees_url":"https://api.github.com/repos/mesosphere/marathon/assignees{/user}","branches_url":"https://api.github.com/repos/mesosphere/marathon/branches{/branch}","tags_url":"https://api.github.com/repos/mesosphere/marathon/tags","blobs_url":"https://api.github.com/repos/mesosphere/marathon/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mesosphere/marathon/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mesosphere/marathon/git/refs{/sha}","trees_url":"https://api.github.com/repos/mesosphere/marathon/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mesosphere/marathon/statuses/{sha}","languages_url":"https://api.github.com/repos/mesosphere/marathon/languages","stargazers_url":"https://api.github.com/repos/mesosphere/marathon/stargazers","contributors_url":"https://api.github.com/repos/mesosphere/marathon/contributors","subscribers_url":"https://api.github.com/repos/mesosphere/marathon/subscribers","subscription_url":"https://api.github.com/repos/mesosphere/marathon/subscription","commits_url":"https://api.github.com/repos/mesosphere/marathon/commits{/sha}","git_commits_url":"https://api.github.com/repos/mesosphere/marathon/git/commits{/sha}","comments_url":"https://api.github.com/repos/mesosphere/marathon/comments{/number}","issue_comment_url":"https://api.github.com/repos/mesosphere/marathon/issues/comments{/number}","contents_url":"https://api.github.com/repos/mesosphere/marathon/contents/{+path}","compare_url":"https://api.github.com/repos/mesosphere/marathon/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mesosphere/marathon/merges","archive_url":"https://api.github.com/repos/mesosphere/marathon/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mesosphere/marathon/downloads","issues_url":"https://api.github.com/repos/mesosphere/marathon/issues{/number}","pulls_url":"https://api.github.com/repos/mesosphere/marathon/pulls{/number}","milestones_url":"https://api.github.com/repos/mesosphere/marathon/milestones{/number}","notifications_url":"https://api.github.com/repos/mesosphere/marathon/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mesosphere/marathon/labels{/name}","releases_url":"https://api.github.com/repos/mesosphere/marathon/releases{/id}","deployments_url":"https://api.github.com/repos/mesosphere/marathon/deployments","created_at":"2013-06-25T14:56:34Z","updated_at":"2018-11-20T07:54:48Z","pushed_at":"2018-11-20T22:51:20Z","git_url":"git://github.com/mesosphere/marathon.git","ssh_url":"git@github.com:mesosphere/marathon.git","clone_url":"https://github.com/mesosphere/marathon.git","svn_url":"https://github.com/mesosphere/marathon","homepage":"https://mesosphere.github.io/marathon/","size":38910,"stargazers_count":3756,"watchers_count":3756,"language":"Scala","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":866,"mirror_url":null,"archived":false,"open_issues_count":15,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":866,"open_issues":15,"watchers":3756,"default_branch":"master"}},"base":{"label":"mesosphere:master","ref":"master","sha":"d7f302d7d8305caf2b2f8726f8d2cd9da3a28488","user":{"login":"mesosphere","id":3458585,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM0NTg1ODU=","avatar_url":"https://avatars0.githubusercontent.com/u/3458585?v=4","gravatar_id":"","url":"https://api.github.com/users/mesosphere","html_url":"https://github.com/mesosphere","followers_url":"https://api.github.com/users/mesosphere/followers","following_url":"https://api.github.com/users/mesosphere/following{/other_user}","gists_url":"https://api.github.com/users/mesosphere/gists{/gist_id}","starred_url":"https://api.github.com/users/mesosphere/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mesosphere/subscriptions","organizations_url":"https://api.github.com/users/mesosphere/orgs","repos_url":"https://api.github.com/users/mesosphere/repos","events_url":"https://api.github.com/users/mesosphere/events{/privacy}","received_events_url":"https://api.github.com/users/mesosphere/received_events","type":"Organization","site_admin":false},"repo":{"id":10941409,"node_id":"MDEwOlJlcG9zaXRvcnkxMDk0MTQwOQ==","name":"marathon","full_name":"mesosphere/marathon","private":false,"owner":{"login":"mesosphere","id":3458585,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM0NTg1ODU=","avatar_url":"https://avatars0.githubusercontent.com/u/3458585?v=4","gravatar_id":"","url":"https://api.github.com/users/mesosphere","html_url":"https://github.com/mesosphere","followers_url":"https://api.github.com/users/mesosphere/followers","following_url":"https://api.github.com/users/mesosphere/following{/other_user}","gists_url":"https://api.github.com/users/mesosphere/gists{/gist_id}","starred_url":"https://api.github.com/users/mesosphere/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mesosphere/subscriptions","organizations_url":"https://api.github.com/users/mesosphere/orgs","repos_url":"https://api.github.com/users/mesosphere/repos","events_url":"https://api.github.com/users/mesosphere/events{/privacy}","received_events_url":"https://api.github.com/users/mesosphere/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/mesosphere/marathon","description":"Deploy and manage containers (including Docker) on top of Apache Mesos at scale.","fork":false,"url":"https://api.github.com/repos/mesosphere/marathon","forks_url":"https://api.github.com/repos/mesosphere/marathon/forks","keys_url":"https://api.github.com/repos/mesosphere/marathon/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mesosphere/marathon/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mesosphere/marathon/teams","hooks_url":"https://api.github.com/repos/mesosphere/marathon/hooks","issue_events_url":"https://api.github.com/repos/mesosphere/marathon/issues/events{/number}","events_url":"https://api.github.com/repos/mesosphere/marathon/events","assignees_url":"https://api.github.com/repos/mesosphere/marathon/assignees{/user}","branches_url":"https://api.github.com/repos/mesosphere/marathon/branches{/branch}","tags_url":"https://api.github.com/repos/mesosphere/marathon/tags","blobs_url":"https://api.github.com/repos/mesosphere/marathon/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mesosphere/marathon/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mesosphere/marathon/git/refs{/sha}","trees_url":"https://api.github.com/repos/mesosphere/marathon/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mesosphere/marathon/statuses/{sha}","languages_url":"https://api.github.com/repos/mesosphere/marathon/languages","stargazers_url":"https://api.github.com/repos/mesosphere/marathon/stargazers","contributors_url":"https://api.github.com/repos/mesosphere/marathon/contributors","subscribers_url":"https://api.github.com/repos/mesosphere/marathon/subscribers","subscription_url":"https://api.github.com/repos/mesosphere/marathon/subscription","commits_url":"https://api.github.com/repos/mesosphere/marathon/commits{/sha}","git_commits_url":"https://api.github.com/repos/mesosphere/marathon/git/commits{/sha}","comments_url":"https://api.github.com/repos/mesosphere/marathon/comments{/number}","issue_comment_url":"https://api.github.com/repos/mesosphere/marathon/issues/comments{/number}","contents_url":"https://api.github.com/repos/mesosphere/marathon/contents/{+path}","compare_url":"https://api.github.com/repos/mesosphere/marathon/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mesosphere/marathon/merges","archive_url":"https://api.github.com/repos/mesosphere/marathon/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mesosphere/marathon/downloads","issues_url":"https://api.github.com/repos/mesosphere/marathon/issues{/number}","pulls_url":"https://api.github.com/repos/mesosphere/marathon/pulls{/number}","milestones_url":"https://api.github.com/repos/mesosphere/marathon/milestones{/number}","notifications_url":"https://api.github.com/repos/mesosphere/marathon/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mesosphere/marathon/labels{/name}","releases_url":"https://api.github.com/repos/mesosphere/marathon/releases{/id}","deployments_url":"https://api.github.com/repos/mesosphere/marathon/deployments","created_at":"2013-06-25T14:56:34Z","updated_at":"2018-11-20T07:54:48Z","pushed_at":"2018-11-20T22:51:20Z","git_url":"git://github.com/mesosphere/marathon.git","ssh_url":"git@github.com:mesosphere/marathon.git","clone_url":"https://github.com/mesosphere/marathon.git","svn_url":"https://github.com/mesosphere/marathon","homepage":"https://mesosphere.github.io/marathon/","size":38910,"stargazers_count":3756,"watchers_count":3756,"language":"Scala","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":866,"mirror_url":null,"archived":false,"open_issues_count":15,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":866,"open_issues":15,"watchers":3756,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mesosphere/marathon/pulls/6616"},"html":{"href":"https://github.com/mesosphere/marathon/pull/6616"},"issue":{"href":"https://api.github.com/repos/mesosphere/marathon/issues/6616"},"comments":{"href":"https://api.github.com/repos/mesosphere/marathon/issues/6616/comments"},"review_comments":{"href":"https://api.github.com/repos/mesosphere/marathon/pulls/6616/comments"},"review_comment":{"href":"https://api.github.com/repos/mesosphere/marathon/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mesosphere/marathon/pulls/6616/commits"},"statuses":{"href":"https://api.github.com/repos/mesosphere/marathon/statuses/bebb78d19fe2e905b5e4c9051aa06b96d0c19a2e"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"alenkacz"}}