{"action":"created","issue":{"url":"https://api.github.com/repos/cockroachdb/cockroach/issues/325","labels_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/325/labels{/name}","comments_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/325/comments","events_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/325/events","html_url":"https://github.com/cockroachdb/cockroach/issues/325","id":57949357,"number":325,"title":"Raft: send MsgAppResp to replica co-located with client","user":{"login":"tschottdorf","id":5076964,"avatar_url":"https://avatars.githubusercontent.com/u/5076964?v=3","gravatar_id":"","url":"https://api.github.com/users/tschottdorf","html_url":"https://github.com/tschottdorf","followers_url":"https://api.github.com/users/tschottdorf/followers","following_url":"https://api.github.com/users/tschottdorf/following{/other_user}","gists_url":"https://api.github.com/users/tschottdorf/gists{/gist_id}","starred_url":"https://api.github.com/users/tschottdorf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tschottdorf/subscriptions","organizations_url":"https://api.github.com/users/tschottdorf/orgs","repos_url":"https://api.github.com/users/tschottdorf/repos","events_url":"https://api.github.com/users/tschottdorf/events{/privacy}","received_events_url":"https://api.github.com/users/tschottdorf/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-02-17T16:51:24Z","updated_at":"2015-02-17T17:26:48Z","closed_at":null,"body":"@spencerkimball mentioned this in #230:\r\n\r\n> Because a major focus for all leasing strategies is to reduce latency in the wide area, we implemented as part of our baseline a latency optimization described by Castro [5]. This optimization reduces the commit latency perceived by clients that are co-located with a replica other than the Multi-Paxos stable leader, by having other replicas transmit their AcceptReplies to both the stable leader and to the replica near the client. Thus, in the common case, the client does not need to wait the additional time for a message to come back from the stable leader, which reduces commit time from four one-way delays to three.\r\n\r\nThe paper is [Miguel Castro and Barbara Liskov. Practical byzantine fault tolerance and proactive recovery. ACM Transactions on Computer Systems, 20(4):398–461, November 2002.](http://research.microsoft.com/en-us/um/people/mcastro/publications/p398-castro-bft-tocs.pdf)\r\n\r\nThis is certainly something that would be useful."},"comment":{"url":"https://api.github.com/repos/cockroachdb/cockroach/issues/comments/74710287","html_url":"https://github.com/cockroachdb/cockroach/issues/325#issuecomment-74710287","issue_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/325","id":74710287,"user":{"login":"bdarnell","id":160562,"avatar_url":"https://avatars.githubusercontent.com/u/160562?v=3","gravatar_id":"","url":"https://api.github.com/users/bdarnell","html_url":"https://github.com/bdarnell","followers_url":"https://api.github.com/users/bdarnell/followers","following_url":"https://api.github.com/users/bdarnell/following{/other_user}","gists_url":"https://api.github.com/users/bdarnell/gists{/gist_id}","starred_url":"https://api.github.com/users/bdarnell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bdarnell/subscriptions","organizations_url":"https://api.github.com/users/bdarnell/orgs","repos_url":"https://api.github.com/users/bdarnell/repos","events_url":"https://api.github.com/users/bdarnell/events{/privacy}","received_events_url":"https://api.github.com/users/bdarnell/received_events","type":"User","site_admin":false},"created_at":"2015-02-17T17:26:48Z","updated_at":"2015-02-17T17:26:48Z","body":"This seems risky when translated from Paxos to Raft. If a leader broadcasts MsgApp and then dies, but the MsgAppResps are sent to the other followers, then those followers may consider the entry committed even though it was not committed by the leader of that term.  This may turn out to be safe (if a quorum have the new log entry then no node without it can be elected), but it's very subtle."}}