{"action":"created","issue":{"url":"https://api.github.com/repos/pingcap/pd/issues/402","repository_url":"https://api.github.com/repos/pingcap/pd","labels_url":"https://api.github.com/repos/pingcap/pd/issues/402/labels{/name}","comments_url":"https://api.github.com/repos/pingcap/pd/issues/402/comments","events_url":"https://api.github.com/repos/pingcap/pd/issues/402/events","html_url":"https://github.com/pingcap/pd/pull/402","id":192176344,"number":402,"title":"[DNM] server/constraints: add replication constraints","user":{"login":"huachaohuang","id":7806468,"avatar_url":"https://avatars.githubusercontent.com/u/7806468?v=3","gravatar_id":"","url":"https://api.github.com/users/huachaohuang","html_url":"https://github.com/huachaohuang","followers_url":"https://api.github.com/users/huachaohuang/followers","following_url":"https://api.github.com/users/huachaohuang/following{/other_user}","gists_url":"https://api.github.com/users/huachaohuang/gists{/gist_id}","starred_url":"https://api.github.com/users/huachaohuang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/huachaohuang/subscriptions","organizations_url":"https://api.github.com/users/huachaohuang/orgs","repos_url":"https://api.github.com/users/huachaohuang/repos","events_url":"https://api.github.com/users/huachaohuang/events{/privacy}","received_events_url":"https://api.github.com/users/huachaohuang/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-11-29T03:05:27Z","updated_at":"2016-11-30T05:52:08Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/pingcap/pd/pulls/402","html_url":"https://github.com/pingcap/pd/pull/402","diff_url":"https://github.com/pingcap/pd/pull/402.diff","patch_url":"https://github.com/pingcap/pd/pull/402.patch"},"body":"This is an example constraints:\r\n\r\n```toml\r\n[[constraints]]\r\nlabels = [\"zone=us\", \"disk=ssd\"]\r\nreplicas = 2\r\n[[constraints]]\r\nlabels = [\"zone=cn\", \"disk=hdd\"]\r\nreplicas = 1\r\n```\r\n\r\nWe need to ensure all constraints will be satisfied in the replica checker, and maintain the constraints when scheduling peers."},"comment":{"url":"https://api.github.com/repos/pingcap/pd/issues/comments/263789579","html_url":"https://github.com/pingcap/pd/pull/402#issuecomment-263789579","issue_url":"https://api.github.com/repos/pingcap/pd/issues/402","id":263789579,"user":{"login":"siddontang","id":1080370,"avatar_url":"https://avatars.githubusercontent.com/u/1080370?v=3","gravatar_id":"","url":"https://api.github.com/users/siddontang","html_url":"https://github.com/siddontang","followers_url":"https://api.github.com/users/siddontang/followers","following_url":"https://api.github.com/users/siddontang/following{/other_user}","gists_url":"https://api.github.com/users/siddontang/gists{/gist_id}","starred_url":"https://api.github.com/users/siddontang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/siddontang/subscriptions","organizations_url":"https://api.github.com/users/siddontang/orgs","repos_url":"https://api.github.com/users/siddontang/repos","events_url":"https://api.github.com/users/siddontang/events{/privacy}","received_events_url":"https://api.github.com/users/siddontang/received_events","type":"User","site_admin":false},"created_at":"2016-11-30T05:52:08Z","updated_at":"2016-11-30T05:52:08Z","body":"should check constraints validation. E,g. if we have max 3 replicas, but the total replicas number > 3, we may panic. "}}
{"actor":{"display_login":"siddontang"}}