{"action":"created","issue":{"url":"https://api.github.com/repos/cockroachdb/cockroach/issues/7201","repository_url":"https://api.github.com/repos/cockroachdb/cockroach","labels_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/7201/labels{/name}","comments_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/7201/comments","events_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/7201/events","html_url":"https://github.com/cockroachdb/cockroach/pull/7201","id":160067249,"number":7201,"title":"storage: use raft log size (in bytes) as metric for truncation","user":{"login":"d4l3k","id":909104,"avatar_url":"https://avatars.githubusercontent.com/u/909104?v=3","gravatar_id":"","url":"https://api.github.com/users/d4l3k","html_url":"https://github.com/d4l3k","followers_url":"https://api.github.com/users/d4l3k/followers","following_url":"https://api.github.com/users/d4l3k/following{/other_user}","gists_url":"https://api.github.com/users/d4l3k/gists{/gist_id}","starred_url":"https://api.github.com/users/d4l3k/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/d4l3k/subscriptions","organizations_url":"https://api.github.com/users/d4l3k/orgs","repos_url":"https://api.github.com/users/d4l3k/repos","events_url":"https://api.github.com/users/d4l3k/events{/privacy}","received_events_url":"https://api.github.com/users/d4l3k/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":21,"created_at":"2016-06-13T23:31:37Z","updated_at":"2016-06-15T22:53:08Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/cockroachdb/cockroach/pulls/7201","html_url":"https://github.com/cockroachdb/cockroach/pull/7201","diff_url":"https://github.com/cockroachdb/cockroach/pull/7201.diff","patch_url":"https://github.com/cockroachdb/cockroach/pull/7201.patch"},"body":"The raft log currently truncates based of the number of entries (max 10000).\r\nThese entries can be of any size so it makes more sense to use the byte size of\r\nthe raft log as a metric for truncation.\r\n\r\nSee #7065.\r\n\r\n<!-- Reviewable:start -->\r\n---\r\nThis change is [<img src=\"https://reviewable.io/review_button.svg\" height=\"35\" align=\"absmiddle\" alt=\"Reviewable\"/>](https://reviewable.io/reviews/cockroachdb/cockroach/7201)\r\n<!-- Reviewable:end -->\r\n"},"comment":{"url":"https://api.github.com/repos/cockroachdb/cockroach/issues/comments/226343520","html_url":"https://github.com/cockroachdb/cockroach/pull/7201#issuecomment-226343520","issue_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/7201","id":226343520,"user":{"login":"d4l3k","id":909104,"avatar_url":"https://avatars.githubusercontent.com/u/909104?v=3","gravatar_id":"","url":"https://api.github.com/users/d4l3k","html_url":"https://github.com/d4l3k","followers_url":"https://api.github.com/users/d4l3k/followers","following_url":"https://api.github.com/users/d4l3k/following{/other_user}","gists_url":"https://api.github.com/users/d4l3k/gists{/gist_id}","starred_url":"https://api.github.com/users/d4l3k/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/d4l3k/subscriptions","organizations_url":"https://api.github.com/users/d4l3k/orgs","repos_url":"https://api.github.com/users/d4l3k/repos","events_url":"https://api.github.com/users/d4l3k/events{/privacy}","received_events_url":"https://api.github.com/users/d4l3k/received_events","type":"User","site_admin":false},"created_at":"2016-06-15T22:53:08Z","updated_at":"2016-06-15T22:53:08Z","body":"\n\n\n\nReview status: 1 of 16 files reviewed at latest revision, 8 unresolved discussions, some commit checks failed.\n\n---\n\n*[storage/raft_log_queue.go, line 106 \\[r6\\]](https://reviewable.io:443/reviews/cockroachdb/cockroach/7201#-KKKfDhY8BiwFB8XAGab:-KKLE-B-xGzm-a9FB5jz:407467318) ([raw file](https://github.com/cockroachdb/cockroach/blob/98c9676e4b69214053196aeb18a11d030dd6e718/storage/raft_log_queue.go#L106)):*\n<details><summary><i>Previously, bdarnell (Ben Darnell) wrote…</i></summary>\n> During a network partition, if a client can talk to a leader that can't reach any of its followers, it could write a bunch of entries into the logs. (This is of course a problem in its own right; we need to introduce some backpressure here)\n</details>\nAh. That makes sense.\n\n---\n\n*[storage/raft_log_queue.go, line 198 \\[r6\\]](https://reviewable.io:443/reviews/cockroachdb/cockroach/7201#-KKKeRcJ5kyWNaA6XNWc:-KKLFb-2p0BUhpJzQdUz:-741841551) ([raw file](https://github.com/cockroachdb/cockroach/blob/98c9676e4b69214053196aeb18a11d030dd6e718/storage/raft_log_queue.go#L198)):*\n<details><summary><i>Previously, bdarnell (Ben Darnell) wrote…</i></summary>\n> It does need to be consistent across all the places where we track this. I think we should be using `len(k)+len(v)` in place of `SysBytes` everywhere. It's more future-proof this way; we don't have to be tied to the particular encoding used.\n</details>\nThat's true. Doesn't it add a lot of overhead to do it that way since we now have to read log entries when we delete them?\n\n---\n\n*[storage/raft_log_queue.go, line 97 \\[r7\\]](https://reviewable.io:443/reviews/cockroachdb/cockroach/7201#-KKLC-7gbk0IzYjz4LvB:-KKLFZiqNW9JR7W7V0lT:-499146009) ([raw file](https://github.com/cockroachdb/cockroach/blob/ebab5f6632798fd8ec0d98a02b6f84240a816346/storage/raft_log_queue.go#L97)):*\n<details><summary><i>Previously, bdarnell (Ben Darnell) wrote…</i></summary>\n> We have a `raftStatus` variable in scope here; don't need to call `r.RaftStatus()` again.\n</details>\nDone.\n\n---\n\n\n*Comments from [Reviewable](https://reviewable.io:443/reviews/cockroachdb/cockroach/7201)*\n<!-- Sent from Reviewable.io -->\n"}}
{"actor":{"display_login":"d4l3k"}}