{"action":"created","comment":{"url":"https://api.github.com/repos/cockroachdb/cockroach/pulls/comments/49362348","id":49362348,"diff_hunk":"@@ -225,3 +246,75 @@ func (ls *Stores) RangeLookup(key roachpb.RKey, _ *roachpb.RangeDescriptor, cons\n \t}\n \treturn br.Responses[0].GetInner().(*roachpb.RangeLookupResponse).Ranges, nil\n }\n+\n+// ReadBootstrapInfo implements the gossip.Persistence interface. Read\n+// attempts to read gossip bootstrap info from every known store and\n+// finds the most recent from all stores to initialize the bootstrap\n+// info argument. Returns nil if no stores contain gossip bootstrap\n+// metadata or an error on any issues reading data from the stores.\n+func (ls *Stores) ReadBootstrapInfo(bi *gossip.BootstrapInfo) error {\n+\tls.biLatestTS = roachpb.ZeroTimestamp\n+\tfor _, s := range ls.storeMap {\n+\t\tvalue, _, err := engine.MVCCGet(s.engine, keys.StoreGossipKey(), ls.clock.Now(), true, nil)\n+\t\tif err != nil {\n+\t\t\treturn err\n+\t\t}\n+\t\tif value != nil && ls.biLatestTS.Less(value.Timestamp) {\n+\t\t\tvar storeBI gossip.BootstrapInfo\n+\t\t\tif err := value.GetProto(&storeBI); err != nil {\n+\t\t\t\treturn err\n+\t\t\t}\n+\t\t\tls.biLatestTS = value.Timestamp\n+\t\t\tls.gossipBI = storeBI\n+\t\t}\n+\t}\n+\t*bi = copyBootstrapInfo(ls.gossipBI)\n+\treturn ls.updateAllBootstrapInfos()\n+}\n+\n+// WriteBootstrapInfo implements the gossip.Persistence\n+// interface. Write persists the supplied bootstrap info to every\n+// known store. Returns nil on success; otherwise returns first error\n+// encountered writing to the stores.\n+func (ls *Stores) WriteBootstrapInfo(bi gossip.BootstrapInfo) error {\n+\tls.biLatestTS = ls.clock.Now()\n+\tls.gossipBI = copyBootstrapInfo(bi)\n+\tfor _, s := range ls.storeMap {\n+\t\tif err := engine.MVCCPutProto(s.engine, nil, keys.StoreGossipKey(), ls.biLatestTS, nil, &ls.gossipBI); err != nil {\n+\t\t\treturn err\n+\t\t}\n+\t\tlog.Infof(\"wrote gossip bootstrap info to %s\", s)\n+\t}\n+\treturn nil\n+}\n+\n+// updateAllBootstrapInfos cycles through all stores and ensures that\n+// the most recent gossip bootstrap information is written to each.\n+func (ls *Stores) updateAllBootstrapInfos() error {\n+\tif ls.biLatestTS.Equal(roachpb.ZeroTimestamp) {\n+\t\treturn nil\n+\t}\n+\tnow := ls.clock.Now()\n+\tfor _, s := range ls.storeMap {\n+\t\tvalue, _, err := engine.MVCCGet(s.engine, keys.StoreGossipKey(), now, true, nil)\n+\t\tif err != nil {\n+\t\t\treturn err\n+\t\t}\n+\t\tif value == nil || value.Timestamp.Less(ls.biLatestTS) {\n+\t\t\tif err := engine.MVCCPutProto(s.engine, nil, keys.StoreGossipKey(), ls.biLatestTS, nil, &ls.gossipBI); err != nil {","path":"storage/stores.go","position":122,"original_position":122,"commit_id":"24b1afc0bc71792a3698f3b03e4c4154a5ae6faf","original_commit_id":"24b1afc0bc71792a3698f3b03e4c4154a5ae6faf","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},"body":"OK, done.","created_at":"2016-01-11T19:02:16Z","updated_at":"2016-01-11T19:02:16Z","html_url":"https://github.com/cockroachdb/cockroach/pull/3711#discussion_r49362348","pull_request_url":"https://api.github.com/repos/cockroachdb/cockroach/pulls/3711","_links":{"self":{"href":"https://api.github.com/repos/cockroachdb/cockroach/pulls/comments/49362348"},"html":{"href":"https://github.com/cockroachdb/cockroach/pull/3711#discussion_r49362348"},"pull_request":{"href":"https://api.github.com/repos/cockroachdb/cockroach/pulls/3711"}}},"pull_request":{"url":"https://api.github.com/repos/cockroachdb/cockroach/pulls/3711","id":55504978,"html_url":"https://github.com/cockroachdb/cockroach/pull/3711","diff_url":"https://github.com/cockroachdb/cockroach/pull/3711.diff","patch_url":"https://github.com/cockroachdb/cockroach/pull/3711.patch","issue_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/3711","number":3711,"state":"open","locked":false,"title":"Enable persistence for gossip bootstrap information.","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},"body":"This change stores gossip hosts in a new BootstrapInfo protobuf\r\nmessage persistently on every store managed by a node. This allows\r\na node to be brought up without specifying the --gossip flag,\r\nassuming of course that there are still extant nodes in the cluster\r\nfrom the last time the node was active.\r\n\r\nMiscellaneous logging fixes for clarity.\n\n<!-- Reviewable:start -->\n[<img src=\"https://reviewable.io/review_button.png\" height=40 alt=\"Review on Reviewable\"/>](https://reviewable.io/reviews/cockroachdb/cockroach/3711)\n<!-- Reviewable:end -->\n","created_at":"2016-01-08T20:11:58Z","updated_at":"2016-01-11T19:02:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e8547b3639c2ca9e3f5561ad0a7dfce229471c31","assignee":{"login":"tschottdorf","id":5076964,"avatar_url":"https://avatars.githubusercontent.com/u/5076964?v=3","gravatar_id":"","url":"https://api.github.com/users/tschottdorf","html_url":"https://github.com/tschottdorf","followers_url":"https://api.github.com/users/tschottdorf/followers","following_url":"https://api.github.com/users/tschottdorf/following{/other_user}","gists_url":"https://api.github.com/users/tschottdorf/gists{/gist_id}","starred_url":"https://api.github.com/users/tschottdorf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tschottdorf/subscriptions","organizations_url":"https://api.github.com/users/tschottdorf/orgs","repos_url":"https://api.github.com/users/tschottdorf/repos","events_url":"https://api.github.com/users/tschottdorf/events{/privacy}","received_events_url":"https://api.github.com/users/tschottdorf/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/cockroachdb/cockroach/pulls/3711/commits","review_comments_url":"https://api.github.com/repos/cockroachdb/cockroach/pulls/3711/comments","review_comment_url":"https://api.github.com/repos/cockroachdb/cockroach/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/3711/comments","statuses_url":"https://api.github.com/repos/cockroachdb/cockroach/statuses/24b1afc0bc71792a3698f3b03e4c4154a5ae6faf","head":{"label":"cockroachdb:spencerkimball/persist-node-descriptors","ref":"spencerkimball/persist-node-descriptors","sha":"24b1afc0bc71792a3698f3b03e4c4154a5ae6faf","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, Survivable, Strongly-Consistent SQL Database","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":"2016-01-11T18:53:52Z","pushed_at":"2016-01-11T18:59:25Z","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":"http://www.cockroachlabs.com","size":60235,"stargazers_count":6027,"watchers_count":6027,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":529,"mirror_url":null,"open_issues_count":260,"forks":529,"open_issues":260,"watchers":6027,"default_branch":"master"}},"base":{"label":"cockroachdb:master","ref":"master","sha":"f1cb4c2c6dbda27d8119bec892e0cc98e1129a3b","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, Survivable, Strongly-Consistent SQL Database","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":"2016-01-11T18:53:52Z","pushed_at":"2016-01-11T18:59:25Z","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":"http://www.cockroachlabs.com","size":60235,"stargazers_count":6027,"watchers_count":6027,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":529,"mirror_url":null,"open_issues_count":260,"forks":529,"open_issues":260,"watchers":6027,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cockroachdb/cockroach/pulls/3711"},"html":{"href":"https://github.com/cockroachdb/cockroach/pull/3711"},"issue":{"href":"https://api.github.com/repos/cockroachdb/cockroach/issues/3711"},"comments":{"href":"https://api.github.com/repos/cockroachdb/cockroach/issues/3711/comments"},"review_comments":{"href":"https://api.github.com/repos/cockroachdb/cockroach/pulls/3711/comments"},"review_comment":{"href":"https://api.github.com/repos/cockroachdb/cockroach/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cockroachdb/cockroach/pulls/3711/commits"},"statuses":{"href":"https://api.github.com/repos/cockroachdb/cockroach/statuses/24b1afc0bc71792a3698f3b03e4c4154a5ae6faf"}}}}