{"action":"created","issue":{"url":"https://api.github.com/repos/pingcap/tikv/issues/994","repository_url":"https://api.github.com/repos/pingcap/tikv","labels_url":"https://api.github.com/repos/pingcap/tikv/issues/994/labels{/name}","comments_url":"https://api.github.com/repos/pingcap/tikv/issues/994/comments","events_url":"https://api.github.com/repos/pingcap/tikv/issues/994/events","html_url":"https://github.com/pingcap/tikv/issues/994","id":173573894,"number":994,"title":"raft: may meet panic out of range in raft log commit_to function","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},"labels":[],"state":"open","locked":false,"assignee":{"login":"hhkbp2","id":1933824,"avatar_url":"https://avatars.githubusercontent.com/u/1933824?v=3","gravatar_id":"","url":"https://api.github.com/users/hhkbp2","html_url":"https://github.com/hhkbp2","followers_url":"https://api.github.com/users/hhkbp2/followers","following_url":"https://api.github.com/users/hhkbp2/following{/other_user}","gists_url":"https://api.github.com/users/hhkbp2/gists{/gist_id}","starred_url":"https://api.github.com/users/hhkbp2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hhkbp2/subscriptions","organizations_url":"https://api.github.com/users/hhkbp2/orgs","repos_url":"https://api.github.com/users/hhkbp2/repos","events_url":"https://api.github.com/users/hhkbp2/events{/privacy}","received_events_url":"https://api.github.com/users/hhkbp2/received_events","type":"User","site_admin":false},"assignees":[{"login":"hhkbp2","id":1933824,"avatar_url":"https://avatars.githubusercontent.com/u/1933824?v=3","gravatar_id":"","url":"https://api.github.com/users/hhkbp2","html_url":"https://github.com/hhkbp2","followers_url":"https://api.github.com/users/hhkbp2/followers","following_url":"https://api.github.com/users/hhkbp2/following{/other_user}","gists_url":"https://api.github.com/users/hhkbp2/gists{/gist_id}","starred_url":"https://api.github.com/users/hhkbp2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hhkbp2/subscriptions","organizations_url":"https://api.github.com/users/hhkbp2/orgs","repos_url":"https://api.github.com/users/hhkbp2/repos","events_url":"https://api.github.com/users/hhkbp2/events{/privacy}","received_events_url":"https://api.github.com/users/hhkbp2/received_events","type":"User","site_admin":false}],"milestone":null,"comments":8,"created_at":"2016-08-27T02:51:35Z","updated_at":"2016-08-27T05:57:13Z","closed_at":null,"body":"RocksDB WAL can guarantee data consistent, but if we meet machine crash, we may still lost data sometimes. \r\nWe may meet following case:\r\n\r\n+ Leader sends a log to follower with log index 10.\r\n+ Follower appends this log and tells leader about it.\r\n+ Leader sets the matched index to 10.\r\n+ Follower crashes, and the RocksDB WAL doesn't flush to disk, we lost the data. \r\n+ Follower restarts, the raft log last index may still 9.\r\n+ Leader sends heartbeat with committed index 10. \r\n+ Follower panics in `commit_to` function.\r\n\r\n/cc @BusyJay @hhkbp2 \r\n\r\nRefer #975"},"comment":{"url":"https://api.github.com/repos/pingcap/tikv/issues/comments/242898559","html_url":"https://github.com/pingcap/tikv/issues/994#issuecomment-242898559","issue_url":"https://api.github.com/repos/pingcap/tikv/issues/994","id":242898559,"user":{"login":"xiang90","id":4479947,"avatar_url":"https://avatars.githubusercontent.com/u/4479947?v=3","gravatar_id":"","url":"https://api.github.com/users/xiang90","html_url":"https://github.com/xiang90","followers_url":"https://api.github.com/users/xiang90/followers","following_url":"https://api.github.com/users/xiang90/following{/other_user}","gists_url":"https://api.github.com/users/xiang90/gists{/gist_id}","starred_url":"https://api.github.com/users/xiang90/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xiang90/subscriptions","organizations_url":"https://api.github.com/users/xiang90/orgs","repos_url":"https://api.github.com/users/xiang90/repos","events_url":"https://api.github.com/users/xiang90/events{/privacy}","received_events_url":"https://api.github.com/users/xiang90/received_events","type":"User","site_admin":false},"created_at":"2016-08-27T05:57:13Z","updated_at":"2016-08-27T05:57:13Z","body":"> that we can remove this peer\r\n\r\nHow can you figure out a peer loses its data if you do not do fsync? You do not know. Now raft panics only because some of the nodes keep some information about others in memory. As I mentioned it is not a reliable detection, and wont be. If you do not do fsync, these information can get lost. Unless you always remove a peer when the process dies, which I do not think is practical. Basically, you have to do fsync. There are tons of ways to reduce the cost of fsync. But it is another topic. The first we need to do is to do fsync before sending back any acks. Then we can improve the performance. Correctness should always come first in my opinion."}}
{"actor":{"display_login":"xiang90"}}