{"action":"created","issue":{"url":"https://api.github.com/repos/coreos/etcd/issues/8314","repository_url":"https://api.github.com/repos/coreos/etcd","labels_url":"https://api.github.com/repos/coreos/etcd/issues/8314/labels{/name}","comments_url":"https://api.github.com/repos/coreos/etcd/issues/8314/comments","events_url":"https://api.github.com/repos/coreos/etcd/issues/8314/events","html_url":"https://github.com/coreos/etcd/pull/8314","id":245876654,"number":8314,"title":"mvcc: fix TestHashKVWhenCompacting hash mismatch","user":{"login":"fanminshi","id":4983345,"avatar_url":"https://avatars3.githubusercontent.com/u/4983345?v=4","gravatar_id":"","url":"https://api.github.com/users/fanminshi","html_url":"https://github.com/fanminshi","followers_url":"https://api.github.com/users/fanminshi/followers","following_url":"https://api.github.com/users/fanminshi/following{/other_user}","gists_url":"https://api.github.com/users/fanminshi/gists{/gist_id}","starred_url":"https://api.github.com/users/fanminshi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fanminshi/subscriptions","organizations_url":"https://api.github.com/users/fanminshi/orgs","repos_url":"https://api.github.com/users/fanminshi/repos","events_url":"https://api.github.com/users/fanminshi/events{/privacy}","received_events_url":"https://api.github.com/users/fanminshi/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-07-26T22:46:31Z","updated_at":"2017-07-31T21:01:06Z","closed_at":"2017-07-31T21:01:06Z","pull_request":{"url":"https://api.github.com/repos/coreos/etcd/pulls/8314","html_url":"https://github.com/coreos/etcd/pull/8314","diff_url":"https://github.com/coreos/etcd/pull/8314.diff","patch_url":"https://github.com/coreos/etcd/pull/8314.patch"},"body":"This pr adds a check in compaction to ensure that setting keep to nil only if this is the latest compaction in queue.\r\n\r\nSuppose that HashKV() starts after compact(A) and compact(B) has scheduled and after\r\ncompletion of compact(A) but before the completion of compact(B).\r\n\r\nBefore this PR:\r\nCompletion of compact(A) sets keep to nil to indicate that there are no ongoing compactions.\r\nThis assumption causes HashKV to hash all mvcc keys including keys that \r\nhasn't been deleted by compact(B) up to a rev. Hence, HashKV again after completion of compact(B) returns\r\na different Hash that during compact(B).\r\n\r\nAfter this PR:\r\nCompletion of compact(A) sets keep to nil if current compactRev == compactRev(compact(A)).\r\nSince calling compact(B) changes current compactRev, then current compactRev != compactRev(compact(A)).\r\nThen HashKV will base on the keep set during compact(B) instead of nil which return the correct hash\r\nduring compact(B).\r\n\r\nfixes  #8311\r\n"},"comment":{"url":"https://api.github.com/repos/coreos/etcd/issues/comments/319195168","html_url":"https://github.com/coreos/etcd/pull/8314#issuecomment-319195168","issue_url":"https://api.github.com/repos/coreos/etcd/issues/8314","id":319195168,"user":{"login":"fanminshi","id":4983345,"avatar_url":"https://avatars3.githubusercontent.com/u/4983345?v=4","gravatar_id":"","url":"https://api.github.com/users/fanminshi","html_url":"https://github.com/fanminshi","followers_url":"https://api.github.com/users/fanminshi/followers","following_url":"https://api.github.com/users/fanminshi/following{/other_user}","gists_url":"https://api.github.com/users/fanminshi/gists{/gist_id}","starred_url":"https://api.github.com/users/fanminshi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fanminshi/subscriptions","organizations_url":"https://api.github.com/users/fanminshi/orgs","repos_url":"https://api.github.com/users/fanminshi/repos","events_url":"https://api.github.com/users/fanminshi/events{/privacy}","received_events_url":"https://api.github.com/users/fanminshi/received_events","type":"User","site_admin":false},"created_at":"2017-07-31T21:01:06Z","updated_at":"2017-07-31T21:01:06Z","body":"close in favor of #8333."}}
{"actor":{"display_login":"fanminshi"}}