{"action":"created","comment":{"url":"https://api.github.com/repos/cockroachdb/cockroach/pulls/comments/31243135","id":31243135,"diff_hunk":"@@ -2413,6 +2413,35 @@ func TestInternalRangeLookupFirstRange(t *testing.T) {\n \t}\n }\n \n+// TestInternalLookupMeta1KeyMax tests that InternalRangeLookup works\n+// correctly with the \"\\x00\\x00meta1\\xff\\xff\" (Meta1Prefix KeyMax)\n+// which is the last key in Meta1Prefix range.\n+// This is the edge case in DecodeRangeMetaKey.\n+func TestInternalRangeLookupMeta1KeyMax(t *testing.T) {\n+\tdefer leaktest.AfterTest(t)\n+\ttc := testContext{}\n+\ttc.Start(t)\n+\tdefer tc.Stop()\n+\n+\treply := proto.InternalRangeLookupResponse{}\n+\tif err := tc.store.ExecuteCmd(context.Background(), client.Call{\n+\t\tArgs: &proto.InternalRangeLookupRequest{\n+\t\t\tRequestHeader: proto.RequestHeader{\n+\t\t\t\tRaftID: 1,\n+\t\t\t\tKey:    proto.MakeKey(keys.Meta1Prefix, proto.KeyMax),\n+\t\t\t},\n+\t\t\tMaxRanges: 1,\n+\t\t},\n+\t\tReply: &reply,\n+\t}); err != nil {\n+\t\tt.Fatal(err)\n+\t}\n+\texpected := []proto.RangeDescriptor{*tc.rng.Desc()}\n+\tif !reflect.DeepEqual(reply.Ranges, expected) {\n+\t\tt.Fatalf(\"expected %+v, got %+v\", expected, reply.Ranges)\n+\t}\n+}\n+","path":"storage/range_test.go","position":32,"original_position":32,"commit_id":"1480c9ca89d4d2f2c849aa52c5e70d99651fd9ca","original_commit_id":"1480c9ca89d4d2f2c849aa52c5e70d99651fd9ca","user":{"login":"es-chow","id":11871102,"avatar_url":"https://avatars.githubusercontent.com/u/11871102?v=3","gravatar_id":"","url":"https://api.github.com/users/es-chow","html_url":"https://github.com/es-chow","followers_url":"https://api.github.com/users/es-chow/followers","following_url":"https://api.github.com/users/es-chow/following{/other_user}","gists_url":"https://api.github.com/users/es-chow/gists{/gist_id}","starred_url":"https://api.github.com/users/es-chow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/es-chow/subscriptions","organizations_url":"https://api.github.com/users/es-chow/orgs","repos_url":"https://api.github.com/users/es-chow/repos","events_url":"https://api.github.com/users/es-chow/events{/privacy}","received_events_url":"https://api.github.com/users/es-chow/received_events","type":"User","site_admin":false},"body":"Thanks, this can be done.","created_at":"2015-05-28T15:09:25Z","updated_at":"2015-05-28T15:09:25Z","html_url":"https://github.com/cockroachdb/cockroach/pull/1171#discussion_r31243135","pull_request_url":"https://api.github.com/repos/cockroachdb/cockroach/pulls/1171","_links":{"self":{"href":"https://api.github.com/repos/cockroachdb/cockroach/pulls/comments/31243135"},"html":{"href":"https://github.com/cockroachdb/cockroach/pull/1171#discussion_r31243135"},"pull_request":{"href":"https://api.github.com/repos/cockroachdb/cockroach/pulls/1171"}}},"pull_request":{"url":"https://api.github.com/repos/cockroachdb/cockroach/pulls/1171","id":36404838,"html_url":"https://github.com/cockroachdb/cockroach/pull/1171","diff_url":"https://github.com/cockroachdb/cockroach/pull/1171.diff","patch_url":"https://github.com/cockroachdb/cockroach/pull/1171.patch","issue_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/1171","number":1171,"state":"open","locked":false,"title":"edge case of Meta1Prefix,KeyMax in range lookup","user":{"login":"es-chow","id":11871102,"avatar_url":"https://avatars.githubusercontent.com/u/11871102?v=3","gravatar_id":"","url":"https://api.github.com/users/es-chow","html_url":"https://github.com/es-chow","followers_url":"https://api.github.com/users/es-chow/followers","following_url":"https://api.github.com/users/es-chow/following{/other_user}","gists_url":"https://api.github.com/users/es-chow/gists{/gist_id}","starred_url":"https://api.github.com/users/es-chow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/es-chow/subscriptions","organizations_url":"https://api.github.com/users/es-chow/orgs","repos_url":"https://api.github.com/users/es-chow/repos","events_url":"https://api.github.com/users/es-chow/events{/privacy}","received_events_url":"https://api.github.com/users/es-chow/received_events","type":"User","site_admin":false},"body":"Edge case of Meta1Prefix+KeyMax (\"\\x00\\x00meta1\\xff\\xff\") in DecodeRangeMetaKey which should not return key.Next() as Meta1Prefix+KeyMax itself is the last key written in Range Metadata. A range lookup for key \"\\x00\\x00meta1\\xff\\xff\" should scan from itself to \"\\x00\\x00meta2\".","created_at":"2015-05-28T13:14:11Z","updated_at":"2015-05-28T15:09:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"67163cb911e823cfa9800d4aac94a87b615ef5fc","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/cockroachdb/cockroach/pulls/1171/commits","review_comments_url":"https://api.github.com/repos/cockroachdb/cockroach/pulls/1171/comments","review_comment_url":"https://api.github.com/repos/cockroachdb/cockroach/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/1171/comments","statuses_url":"https://api.github.com/repos/cockroachdb/cockroach/statuses/1480c9ca89d4d2f2c849aa52c5e70d99651fd9ca","head":{"label":"es-chow:edge-case-meta1keymax","ref":"edge-case-meta1keymax","sha":"1480c9ca89d4d2f2c849aa52c5e70d99651fd9ca","user":{"login":"es-chow","id":11871102,"avatar_url":"https://avatars.githubusercontent.com/u/11871102?v=3","gravatar_id":"","url":"https://api.github.com/users/es-chow","html_url":"https://github.com/es-chow","followers_url":"https://api.github.com/users/es-chow/followers","following_url":"https://api.github.com/users/es-chow/following{/other_user}","gists_url":"https://api.github.com/users/es-chow/gists{/gist_id}","starred_url":"https://api.github.com/users/es-chow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/es-chow/subscriptions","organizations_url":"https://api.github.com/users/es-chow/orgs","repos_url":"https://api.github.com/users/es-chow/repos","events_url":"https://api.github.com/users/es-chow/events{/privacy}","received_events_url":"https://api.github.com/users/es-chow/received_events","type":"User","site_admin":false},"repo":{"id":33779013,"name":"cockroach","full_name":"es-chow/cockroach","owner":{"login":"es-chow","id":11871102,"avatar_url":"https://avatars.githubusercontent.com/u/11871102?v=3","gravatar_id":"","url":"https://api.github.com/users/es-chow","html_url":"https://github.com/es-chow","followers_url":"https://api.github.com/users/es-chow/followers","following_url":"https://api.github.com/users/es-chow/following{/other_user}","gists_url":"https://api.github.com/users/es-chow/gists{/gist_id}","starred_url":"https://api.github.com/users/es-chow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/es-chow/subscriptions","organizations_url":"https://api.github.com/users/es-chow/orgs","repos_url":"https://api.github.com/users/es-chow/repos","events_url":"https://api.github.com/users/es-chow/events{/privacy}","received_events_url":"https://api.github.com/users/es-chow/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/es-chow/cockroach","description":"A Scalable, Geo-Replicated, Transactional Datastore","fork":true,"url":"https://api.github.com/repos/es-chow/cockroach","forks_url":"https://api.github.com/repos/es-chow/cockroach/forks","keys_url":"https://api.github.com/repos/es-chow/cockroach/keys{/key_id}","collaborators_url":"https://api.github.com/repos/es-chow/cockroach/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/es-chow/cockroach/teams","hooks_url":"https://api.github.com/repos/es-chow/cockroach/hooks","issue_events_url":"https://api.github.com/repos/es-chow/cockroach/issues/events{/number}","events_url":"https://api.github.com/repos/es-chow/cockroach/events","assignees_url":"https://api.github.com/repos/es-chow/cockroach/assignees{/user}","branches_url":"https://api.github.com/repos/es-chow/cockroach/branches{/branch}","tags_url":"https://api.github.com/repos/es-chow/cockroach/tags","blobs_url":"https://api.github.com/repos/es-chow/cockroach/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/es-chow/cockroach/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/es-chow/cockroach/git/refs{/sha}","trees_url":"https://api.github.com/repos/es-chow/cockroach/git/trees{/sha}","statuses_url":"https://api.github.com/repos/es-chow/cockroach/statuses/{sha}","languages_url":"https://api.github.com/repos/es-chow/cockroach/languages","stargazers_url":"https://api.github.com/repos/es-chow/cockroach/stargazers","contributors_url":"https://api.github.com/repos/es-chow/cockroach/contributors","subscribers_url":"https://api.github.com/repos/es-chow/cockroach/subscribers","subscription_url":"https://api.github.com/repos/es-chow/cockroach/subscription","commits_url":"https://api.github.com/repos/es-chow/cockroach/commits{/sha}","git_commits_url":"https://api.github.com/repos/es-chow/cockroach/git/commits{/sha}","comments_url":"https://api.github.com/repos/es-chow/cockroach/comments{/number}","issue_comment_url":"https://api.github.com/repos/es-chow/cockroach/issues/comments{/number}","contents_url":"https://api.github.com/repos/es-chow/cockroach/contents/{+path}","compare_url":"https://api.github.com/repos/es-chow/cockroach/compare/{base}...{head}","merges_url":"https://api.github.com/repos/es-chow/cockroach/merges","archive_url":"https://api.github.com/repos/es-chow/cockroach/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/es-chow/cockroach/downloads","issues_url":"https://api.github.com/repos/es-chow/cockroach/issues{/number}","pulls_url":"https://api.github.com/repos/es-chow/cockroach/pulls{/number}","milestones_url":"https://api.github.com/repos/es-chow/cockroach/milestones{/number}","notifications_url":"https://api.github.com/repos/es-chow/cockroach/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/es-chow/cockroach/labels{/name}","releases_url":"https://api.github.com/repos/es-chow/cockroach/releases{/id}","created_at":"2015-04-11T14:36:53Z","updated_at":"2015-04-28T14:15:38Z","pushed_at":"2015-05-28T13:06:37Z","git_url":"git://github.com/es-chow/cockroach.git","ssh_url":"git@github.com:es-chow/cockroach.git","clone_url":"https://github.com/es-chow/cockroach.git","svn_url":"https://github.com/es-chow/cockroach","homepage":null,"size":17429,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"cockroachdb:master","ref":"master","sha":"458b565350ac3675d6829bc5a6514dac39135c86","user":{"login":"cockroachdb","id":6748139,"avatar_url":"https://avatars.githubusercontent.com/u/6748139?v=3","gravatar_id":"","url":"https://api.github.com/users/cockroachdb","html_url":"https://github.com/cockroachdb","followers_url":"https://api.github.com/users/cockroachdb/followers","following_url":"https://api.github.com/users/cockroachdb/following{/other_user}","gists_url":"https://api.github.com/users/cockroachdb/gists{/gist_id}","starred_url":"https://api.github.com/users/cockroachdb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cockroachdb/subscriptions","organizations_url":"https://api.github.com/users/cockroachdb/orgs","repos_url":"https://api.github.com/users/cockroachdb/repos","events_url":"https://api.github.com/users/cockroachdb/events{/privacy}","received_events_url":"https://api.github.com/users/cockroachdb/received_events","type":"Organization","site_admin":false},"repo":{"id":16563587,"name":"cockroach","full_name":"cockroachdb/cockroach","owner":{"login":"cockroachdb","id":6748139,"avatar_url":"https://avatars.githubusercontent.com/u/6748139?v=3","gravatar_id":"","url":"https://api.github.com/users/cockroachdb","html_url":"https://github.com/cockroachdb","followers_url":"https://api.github.com/users/cockroachdb/followers","following_url":"https://api.github.com/users/cockroachdb/following{/other_user}","gists_url":"https://api.github.com/users/cockroachdb/gists{/gist_id}","starred_url":"https://api.github.com/users/cockroachdb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cockroachdb/subscriptions","organizations_url":"https://api.github.com/users/cockroachdb/orgs","repos_url":"https://api.github.com/users/cockroachdb/repos","events_url":"https://api.github.com/users/cockroachdb/events{/privacy}","received_events_url":"https://api.github.com/users/cockroachdb/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cockroachdb/cockroach","description":"A Scalable, Geo-Replicated, Transactional Datastore","fork":false,"url":"https://api.github.com/repos/cockroachdb/cockroach","forks_url":"https://api.github.com/repos/cockroachdb/cockroach/forks","keys_url":"https://api.github.com/repos/cockroachdb/cockroach/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cockroachdb/cockroach/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cockroachdb/cockroach/teams","hooks_url":"https://api.github.com/repos/cockroachdb/cockroach/hooks","issue_events_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/events{/number}","events_url":"https://api.github.com/repos/cockroachdb/cockroach/events","assignees_url":"https://api.github.com/repos/cockroachdb/cockroach/assignees{/user}","branches_url":"https://api.github.com/repos/cockroachdb/cockroach/branches{/branch}","tags_url":"https://api.github.com/repos/cockroachdb/cockroach/tags","blobs_url":"https://api.github.com/repos/cockroachdb/cockroach/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cockroachdb/cockroach/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cockroachdb/cockroach/git/refs{/sha}","trees_url":"https://api.github.com/repos/cockroachdb/cockroach/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cockroachdb/cockroach/statuses/{sha}","languages_url":"https://api.github.com/repos/cockroachdb/cockroach/languages","stargazers_url":"https://api.github.com/repos/cockroachdb/cockroach/stargazers","contributors_url":"https://api.github.com/repos/cockroachdb/cockroach/contributors","subscribers_url":"https://api.github.com/repos/cockroachdb/cockroach/subscribers","subscription_url":"https://api.github.com/repos/cockroachdb/cockroach/subscription","commits_url":"https://api.github.com/repos/cockroachdb/cockroach/commits{/sha}","git_commits_url":"https://api.github.com/repos/cockroachdb/cockroach/git/commits{/sha}","comments_url":"https://api.github.com/repos/cockroachdb/cockroach/comments{/number}","issue_comment_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/comments{/number}","contents_url":"https://api.github.com/repos/cockroachdb/cockroach/contents/{+path}","compare_url":"https://api.github.com/repos/cockroachdb/cockroach/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cockroachdb/cockroach/merges","archive_url":"https://api.github.com/repos/cockroachdb/cockroach/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cockroachdb/cockroach/downloads","issues_url":"https://api.github.com/repos/cockroachdb/cockroach/issues{/number}","pulls_url":"https://api.github.com/repos/cockroachdb/cockroach/pulls{/number}","milestones_url":"https://api.github.com/repos/cockroachdb/cockroach/milestones{/number}","notifications_url":"https://api.github.com/repos/cockroachdb/cockroach/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cockroachdb/cockroach/labels{/name}","releases_url":"https://api.github.com/repos/cockroachdb/cockroach/releases{/id}","created_at":"2014-02-06T00:18:47Z","updated_at":"2015-05-28T04:15:24Z","pushed_at":"2015-05-28T14:58:17Z","git_url":"git://github.com/cockroachdb/cockroach.git","ssh_url":"git@github.com:cockroachdb/cockroach.git","clone_url":"https://github.com/cockroachdb/cockroach.git","svn_url":"https://github.com/cockroachdb/cockroach","homepage":null,"size":40323,"stargazers_count":3463,"watchers_count":3463,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":276,"mirror_url":null,"open_issues_count":75,"forks":276,"open_issues":75,"watchers":3463,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cockroachdb/cockroach/pulls/1171"},"html":{"href":"https://github.com/cockroachdb/cockroach/pull/1171"},"issue":{"href":"https://api.github.com/repos/cockroachdb/cockroach/issues/1171"},"comments":{"href":"https://api.github.com/repos/cockroachdb/cockroach/issues/1171/comments"},"review_comments":{"href":"https://api.github.com/repos/cockroachdb/cockroach/pulls/1171/comments"},"review_comment":{"href":"https://api.github.com/repos/cockroachdb/cockroach/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cockroachdb/cockroach/pulls/1171/commits"},"statuses":{"href":"https://api.github.com/repos/cockroachdb/cockroach/statuses/1480c9ca89d4d2f2c849aa52c5e70d99651fd9ca"}}}}