{"action":"closed","issue":{"url":"https://api.github.com/repos/cockroachdb/cockroach/issues/543","labels_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/543/labels{/name}","comments_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/543/comments","events_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/543/events","html_url":"https://github.com/cockroachdb/cockroach/issues/543","id":65781862,"number":543,"title":"Leader leases","user":{"login":"spencerkimball","id":6147149,"avatar_url":"https://avatars.githubusercontent.com/u/6147149?v=3","gravatar_id":"","url":"https://api.github.com/users/spencerkimball","html_url":"https://github.com/spencerkimball","followers_url":"https://api.github.com/users/spencerkimball/followers","following_url":"https://api.github.com/users/spencerkimball/following{/other_user}","gists_url":"https://api.github.com/users/spencerkimball/gists{/gist_id}","starred_url":"https://api.github.com/users/spencerkimball/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spencerkimball/subscriptions","organizations_url":"https://api.github.com/users/spencerkimball/orgs","repos_url":"https://api.github.com/users/spencerkimball/repos","events_url":"https://api.github.com/users/spencerkimball/events{/privacy}","received_events_url":"https://api.github.com/users/spencerkimball/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":{"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},"milestone":null,"comments":10,"created_at":"2015-04-01T21:23:04Z","updated_at":"2015-04-29T17:31:27Z","closed_at":"2015-04-29T17:31:26Z","body":"- Rename Range.IsLeader() to Range.HaveLeaderLease(). This method returns whether or not the replica has the leader lease. Only replicas which have the leader lease my respond to \"CONSISTENT\" read requests or may satisfy read-write requests.\r\n\r\n- Any read-write request (e.g. Put, ConditionalPut, Delete, DeleteRange) must go through Range.addReadWriteCmd(). This method properly uses the read timestamp cache to adjust timestamps or restart transactions as necessary.\r\n\r\n- Raft forwarding needs to be disabled or else forwarded entries must be pushed through Range.addReadWriteCmd() at the replica for which HaveLeaderLease() is true.\r\n\r\n- All entries in terms before current leader's new term must be applied before HaveLeaderLease() method returns true.\r\n\r\n- Propose that blank entry which is first in a new leader's term be changed to a lease entry which serves same purpose, but additionally provides a lease interval, before which any accepting replica must not vote in a new election. This will require a change similar to the one used to support config changes. It will also require a hook inside raft which allows multiraft to decide whether or not to vote on an election according to any leases which it's agreed to."}}