{"action":"created","comment":{"url":"https://api.github.com/repos/m3db/m3cluster/pulls/comments/140666679","pull_request_review_id":64771929,"id":140666679,"diff_hunk":"@@ -197,16 +206,25 @@ func (a mirroredAlgorithm) ReplaceInstances(\n \tleavingInstanceIDs []string,\n \taddingInstances []placement.Instance,\n ) (placement.Placement, error) {\n-\tif err := a.IsCompatibleWith(p); err != nil {\n+\terr := a.IsCompatibleWith(p)\n+\tif err != nil {\n \t\treturn nil, err\n \t}\n \n \tif len(addingInstances) != len(leavingInstanceIDs) {\n \t\treturn nil, fmt.Errorf(\"could not replace %d instances with %d instances for mirrored replace\", len(leavingInstanceIDs), len(addingInstances))\n \t}\n \n-\tp, err := placement.MarkAllShardsAsAvailable(p)\n-\tif err != nil {\n+\tvar (\n+\t\tnowNanos               = a.opts.NowFn()().UnixNano()\n+\t\tshouldCheckCutoverTime = true\n+\t)\n+\tif allLeaving(p, addingInstances, nowNanos) && allInitializing(p, leavingInstanceIDs, nowNanos) {\n+\t\t// Allow marking shards as available without checking cutover time in a reverting case.\n+\t\tshouldCheckCutoverTime = false","path":"placement/algo/mirrored.go","position":null,"original_position":72,"commit_id":"0269c82cb5e4bb422bd8472ccb0c0814eda8fb44","original_commit_id":"fcbc3c24c2a90b3378ae945939ff047503011da0","user":{"login":"cw9","id":6710599,"avatar_url":"https://avatars0.githubusercontent.com/u/6710599?v=4","gravatar_id":"","url":"https://api.github.com/users/cw9","html_url":"https://github.com/cw9","followers_url":"https://api.github.com/users/cw9/followers","following_url":"https://api.github.com/users/cw9/following{/other_user}","gists_url":"https://api.github.com/users/cw9/gists{/gist_id}","starred_url":"https://api.github.com/users/cw9/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cw9/subscriptions","organizations_url":"https://api.github.com/users/cw9/orgs","repos_url":"https://api.github.com/users/cw9/repos","events_url":"https://api.github.com/users/cw9/events{/privacy}","received_events_url":"https://api.github.com/users/cw9/received_events","type":"User","site_admin":false},"body":"We are only reverting for add and remove right now, we could do the same for replace but for some reason we are not doing that, I can't recall why now, but adding the same reverting for replace is simple, I could do that in a follow up diff if that's what we want.","created_at":"2017-09-24T20:22:27Z","updated_at":"2017-09-24T20:22:27Z","html_url":"https://github.com/m3db/m3cluster/pull/171#discussion_r140666679","pull_request_url":"https://api.github.com/repos/m3db/m3cluster/pulls/171","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/m3db/m3cluster/pulls/comments/140666679"},"html":{"href":"https://github.com/m3db/m3cluster/pull/171#discussion_r140666679"},"pull_request":{"href":"https://api.github.com/repos/m3db/m3cluster/pulls/171"}},"in_reply_to_id":140262630},"pull_request":{"url":"https://api.github.com/repos/m3db/m3cluster/pulls/171","id":141753673,"html_url":"https://github.com/m3db/m3cluster/pull/171","diff_url":"https://github.com/m3db/m3cluster/pull/171.diff","patch_url":"https://github.com/m3db/m3cluster/pull/171.patch","issue_url":"https://api.github.com/repos/m3db/m3cluster/issues/171","number":171,"state":"open","locked":false,"title":"Disallow marking shards as available before cutover, Disallow reverting after cutover","user":{"login":"cw9","id":6710599,"avatar_url":"https://avatars0.githubusercontent.com/u/6710599?v=4","gravatar_id":"","url":"https://api.github.com/users/cw9","html_url":"https://github.com/cw9","followers_url":"https://api.github.com/users/cw9/followers","following_url":"https://api.github.com/users/cw9/following{/other_user}","gists_url":"https://api.github.com/users/cw9/gists{/gist_id}","starred_url":"https://api.github.com/users/cw9/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cw9/subscriptions","organizations_url":"https://api.github.com/users/cw9/orgs","repos_url":"https://api.github.com/users/cw9/repos","events_url":"https://api.github.com/users/cw9/events{/privacy}","received_events_url":"https://api.github.com/users/cw9/received_events","type":"User","site_admin":false},"body":"Moved MarkShardAvailable to algo interface\r\nCheck current time before marking shards as available\r\n\r\n@xichen2020 @prateek @jeromefroe ","created_at":"2017-09-19T04:08:19Z","updated_at":"2017-09-24T20:22:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f681dba2e5341a45fb238c37150218e6c1890236","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/m3db/m3cluster/pulls/171/commits","review_comments_url":"https://api.github.com/repos/m3db/m3cluster/pulls/171/comments","review_comment_url":"https://api.github.com/repos/m3db/m3cluster/pulls/comments{/number}","comments_url":"https://api.github.com/repos/m3db/m3cluster/issues/171/comments","statuses_url":"https://api.github.com/repos/m3db/m3cluster/statuses/0269c82cb5e4bb422bd8472ccb0c0814eda8fb44","head":{"label":"m3db:chao-not-revert-after-cutover","ref":"chao-not-revert-after-cutover","sha":"0269c82cb5e4bb422bd8472ccb0c0814eda8fb44","user":{"login":"m3db","id":19937171,"avatar_url":"https://avatars0.githubusercontent.com/u/19937171?v=4","gravatar_id":"","url":"https://api.github.com/users/m3db","html_url":"https://github.com/m3db","followers_url":"https://api.github.com/users/m3db/followers","following_url":"https://api.github.com/users/m3db/following{/other_user}","gists_url":"https://api.github.com/users/m3db/gists{/gist_id}","starred_url":"https://api.github.com/users/m3db/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/m3db/subscriptions","organizations_url":"https://api.github.com/users/m3db/orgs","repos_url":"https://api.github.com/users/m3db/repos","events_url":"https://api.github.com/users/m3db/events{/privacy}","received_events_url":"https://api.github.com/users/m3db/received_events","type":"Organization","site_admin":false},"repo":{"id":64314919,"name":"m3cluster","full_name":"m3db/m3cluster","owner":{"login":"m3db","id":19937171,"avatar_url":"https://avatars0.githubusercontent.com/u/19937171?v=4","gravatar_id":"","url":"https://api.github.com/users/m3db","html_url":"https://github.com/m3db","followers_url":"https://api.github.com/users/m3db/followers","following_url":"https://api.github.com/users/m3db/following{/other_user}","gists_url":"https://api.github.com/users/m3db/gists{/gist_id}","starred_url":"https://api.github.com/users/m3db/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/m3db/subscriptions","organizations_url":"https://api.github.com/users/m3db/orgs","repos_url":"https://api.github.com/users/m3db/repos","events_url":"https://api.github.com/users/m3db/events{/privacy}","received_events_url":"https://api.github.com/users/m3db/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/m3db/m3cluster","description":"Cluster management (service discovery, runtime config distribution) supporting pluggable backends","fork":false,"url":"https://api.github.com/repos/m3db/m3cluster","forks_url":"https://api.github.com/repos/m3db/m3cluster/forks","keys_url":"https://api.github.com/repos/m3db/m3cluster/keys{/key_id}","collaborators_url":"https://api.github.com/repos/m3db/m3cluster/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/m3db/m3cluster/teams","hooks_url":"https://api.github.com/repos/m3db/m3cluster/hooks","issue_events_url":"https://api.github.com/repos/m3db/m3cluster/issues/events{/number}","events_url":"https://api.github.com/repos/m3db/m3cluster/events","assignees_url":"https://api.github.com/repos/m3db/m3cluster/assignees{/user}","branches_url":"https://api.github.com/repos/m3db/m3cluster/branches{/branch}","tags_url":"https://api.github.com/repos/m3db/m3cluster/tags","blobs_url":"https://api.github.com/repos/m3db/m3cluster/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/m3db/m3cluster/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/m3db/m3cluster/git/refs{/sha}","trees_url":"https://api.github.com/repos/m3db/m3cluster/git/trees{/sha}","statuses_url":"https://api.github.com/repos/m3db/m3cluster/statuses/{sha}","languages_url":"https://api.github.com/repos/m3db/m3cluster/languages","stargazers_url":"https://api.github.com/repos/m3db/m3cluster/stargazers","contributors_url":"https://api.github.com/repos/m3db/m3cluster/contributors","subscribers_url":"https://api.github.com/repos/m3db/m3cluster/subscribers","subscription_url":"https://api.github.com/repos/m3db/m3cluster/subscription","commits_url":"https://api.github.com/repos/m3db/m3cluster/commits{/sha}","git_commits_url":"https://api.github.com/repos/m3db/m3cluster/git/commits{/sha}","comments_url":"https://api.github.com/repos/m3db/m3cluster/comments{/number}","issue_comment_url":"https://api.github.com/repos/m3db/m3cluster/issues/comments{/number}","contents_url":"https://api.github.com/repos/m3db/m3cluster/contents/{+path}","compare_url":"https://api.github.com/repos/m3db/m3cluster/compare/{base}...{head}","merges_url":"https://api.github.com/repos/m3db/m3cluster/merges","archive_url":"https://api.github.com/repos/m3db/m3cluster/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/m3db/m3cluster/downloads","issues_url":"https://api.github.com/repos/m3db/m3cluster/issues{/number}","pulls_url":"https://api.github.com/repos/m3db/m3cluster/pulls{/number}","milestones_url":"https://api.github.com/repos/m3db/m3cluster/milestones{/number}","notifications_url":"https://api.github.com/repos/m3db/m3cluster/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/m3db/m3cluster/labels{/name}","releases_url":"https://api.github.com/repos/m3db/m3cluster/releases{/id}","deployments_url":"https://api.github.com/repos/m3db/m3cluster/deployments","created_at":"2016-07-27T14:22:38Z","updated_at":"2017-07-14T00:56:48Z","pushed_at":"2017-09-22T02:39:20Z","git_url":"git://github.com/m3db/m3cluster.git","ssh_url":"git@github.com:m3db/m3cluster.git","clone_url":"https://github.com/m3db/m3cluster.git","svn_url":"https://github.com/m3db/m3cluster","homepage":"","size":721,"stargazers_count":8,"watchers_count":8,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":12,"forks":1,"open_issues":12,"watchers":8,"default_branch":"master"}},"base":{"label":"m3db:master","ref":"master","sha":"5a29979ec2d26c8c7c7d3274d3c5ffdc1e9fcb40","user":{"login":"m3db","id":19937171,"avatar_url":"https://avatars0.githubusercontent.com/u/19937171?v=4","gravatar_id":"","url":"https://api.github.com/users/m3db","html_url":"https://github.com/m3db","followers_url":"https://api.github.com/users/m3db/followers","following_url":"https://api.github.com/users/m3db/following{/other_user}","gists_url":"https://api.github.com/users/m3db/gists{/gist_id}","starred_url":"https://api.github.com/users/m3db/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/m3db/subscriptions","organizations_url":"https://api.github.com/users/m3db/orgs","repos_url":"https://api.github.com/users/m3db/repos","events_url":"https://api.github.com/users/m3db/events{/privacy}","received_events_url":"https://api.github.com/users/m3db/received_events","type":"Organization","site_admin":false},"repo":{"id":64314919,"name":"m3cluster","full_name":"m3db/m3cluster","owner":{"login":"m3db","id":19937171,"avatar_url":"https://avatars0.githubusercontent.com/u/19937171?v=4","gravatar_id":"","url":"https://api.github.com/users/m3db","html_url":"https://github.com/m3db","followers_url":"https://api.github.com/users/m3db/followers","following_url":"https://api.github.com/users/m3db/following{/other_user}","gists_url":"https://api.github.com/users/m3db/gists{/gist_id}","starred_url":"https://api.github.com/users/m3db/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/m3db/subscriptions","organizations_url":"https://api.github.com/users/m3db/orgs","repos_url":"https://api.github.com/users/m3db/repos","events_url":"https://api.github.com/users/m3db/events{/privacy}","received_events_url":"https://api.github.com/users/m3db/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/m3db/m3cluster","description":"Cluster management (service discovery, runtime config distribution) supporting pluggable backends","fork":false,"url":"https://api.github.com/repos/m3db/m3cluster","forks_url":"https://api.github.com/repos/m3db/m3cluster/forks","keys_url":"https://api.github.com/repos/m3db/m3cluster/keys{/key_id}","collaborators_url":"https://api.github.com/repos/m3db/m3cluster/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/m3db/m3cluster/teams","hooks_url":"https://api.github.com/repos/m3db/m3cluster/hooks","issue_events_url":"https://api.github.com/repos/m3db/m3cluster/issues/events{/number}","events_url":"https://api.github.com/repos/m3db/m3cluster/events","assignees_url":"https://api.github.com/repos/m3db/m3cluster/assignees{/user}","branches_url":"https://api.github.com/repos/m3db/m3cluster/branches{/branch}","tags_url":"https://api.github.com/repos/m3db/m3cluster/tags","blobs_url":"https://api.github.com/repos/m3db/m3cluster/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/m3db/m3cluster/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/m3db/m3cluster/git/refs{/sha}","trees_url":"https://api.github.com/repos/m3db/m3cluster/git/trees{/sha}","statuses_url":"https://api.github.com/repos/m3db/m3cluster/statuses/{sha}","languages_url":"https://api.github.com/repos/m3db/m3cluster/languages","stargazers_url":"https://api.github.com/repos/m3db/m3cluster/stargazers","contributors_url":"https://api.github.com/repos/m3db/m3cluster/contributors","subscribers_url":"https://api.github.com/repos/m3db/m3cluster/subscribers","subscription_url":"https://api.github.com/repos/m3db/m3cluster/subscription","commits_url":"https://api.github.com/repos/m3db/m3cluster/commits{/sha}","git_commits_url":"https://api.github.com/repos/m3db/m3cluster/git/commits{/sha}","comments_url":"https://api.github.com/repos/m3db/m3cluster/comments{/number}","issue_comment_url":"https://api.github.com/repos/m3db/m3cluster/issues/comments{/number}","contents_url":"https://api.github.com/repos/m3db/m3cluster/contents/{+path}","compare_url":"https://api.github.com/repos/m3db/m3cluster/compare/{base}...{head}","merges_url":"https://api.github.com/repos/m3db/m3cluster/merges","archive_url":"https://api.github.com/repos/m3db/m3cluster/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/m3db/m3cluster/downloads","issues_url":"https://api.github.com/repos/m3db/m3cluster/issues{/number}","pulls_url":"https://api.github.com/repos/m3db/m3cluster/pulls{/number}","milestones_url":"https://api.github.com/repos/m3db/m3cluster/milestones{/number}","notifications_url":"https://api.github.com/repos/m3db/m3cluster/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/m3db/m3cluster/labels{/name}","releases_url":"https://api.github.com/repos/m3db/m3cluster/releases{/id}","deployments_url":"https://api.github.com/repos/m3db/m3cluster/deployments","created_at":"2016-07-27T14:22:38Z","updated_at":"2017-07-14T00:56:48Z","pushed_at":"2017-09-22T02:39:20Z","git_url":"git://github.com/m3db/m3cluster.git","ssh_url":"git@github.com:m3db/m3cluster.git","clone_url":"https://github.com/m3db/m3cluster.git","svn_url":"https://github.com/m3db/m3cluster","homepage":"","size":721,"stargazers_count":8,"watchers_count":8,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":12,"forks":1,"open_issues":12,"watchers":8,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/m3db/m3cluster/pulls/171"},"html":{"href":"https://github.com/m3db/m3cluster/pull/171"},"issue":{"href":"https://api.github.com/repos/m3db/m3cluster/issues/171"},"comments":{"href":"https://api.github.com/repos/m3db/m3cluster/issues/171/comments"},"review_comments":{"href":"https://api.github.com/repos/m3db/m3cluster/pulls/171/comments"},"review_comment":{"href":"https://api.github.com/repos/m3db/m3cluster/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/m3db/m3cluster/pulls/171/commits"},"statuses":{"href":"https://api.github.com/repos/m3db/m3cluster/statuses/0269c82cb5e4bb422bd8472ccb0c0814eda8fb44"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"cw9"}}