{"action":"created","comment":{"url":"https://api.github.com/repos/cockroachdb/cockroach/pulls/comments/38261988","id":38261988,"diff_hunk":"@@ -0,0 +1,304 @@\n+// Copyright 2015 The Cockroach Authors.\n+//\n+// Licensed under the Apache License, Version 2.0 (the \"License\");\n+// you may not use this file except in compliance with the License.\n+// You may obtain a copy of the License at\n+//\n+//     http://www.apache.org/licenses/LICENSE-2.0\n+//\n+// Unless required by applicable law or agreed to in writing, software\n+// distributed under the License is distributed on an \"AS IS\" BASIS,\n+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n+// implied. See the License for the specific language governing\n+// permissions and limitations under the License. See the AUTHORS file\n+// for names of contributors.\n+//\n+// Author: Bram Gruneir (bram+code@cockroachlabs.com)\n+\n+package storage\n+\n+import (\n+\t\"container/heap\"\n+\t\"sort\"\n+\t\"sync\"\n+\t\"time\"\n+\n+\tgogoproto \"github.com/gogo/protobuf/proto\"\n+\n+\t\"github.com/cockroachdb/cockroach/gossip\"\n+\t\"github.com/cockroachdb/cockroach/proto\"\n+\t\"github.com/cockroachdb/cockroach/util/hlc\"\n+\t\"github.com/cockroachdb/cockroach/util/log\"\n+\t\"github.com/cockroachdb/cockroach/util/stop\"\n+)\n+\n+const (\n+\t// testTimeUntilStoreDead is the the test value for TimeUntilStoreDead to\n+\t// quickly mark stores as dead.\n+\ttestTimeUntilStoreDead = 10 * time.Millisecond\n+\n+\t// TestTimeUntilStoreDeadOff is the test value for TimeUntilStoreDead that\n+\t// prevents the store pool from marking stores as dead.\n+\tTestTimeUntilStoreDeadOff = 24 * time.Hour\n+)\n+\n+type storeDetail struct {\n+\tdesc            proto.StoreDescriptor\n+\tdead            bool\n+\ttimesDied       int\n+\tfoundDeadOn     time.Time\n+\tlastUpdatedTime time.Time // This is also the priority for the queue.\n+\tindex           int       // index of the item in the heap, required for heap.Interface\n+}\n+\n+// markDead sets the storeDetail to dead(inactive).\n+func (sd *storeDetail) markDead(foundDeadOn time.Time) {\n+\tsd.dead = true\n+\tsd.foundDeadOn = foundDeadOn\n+\tsd.timesDied++\n+\tlog.Warningf(\"store %s on node %s is now considered offline\", sd.desc.StoreID, sd.desc.Node.NodeID)\n+}\n+\n+// markAlive sets the storeDetail to alive(active) and saves the updated time\n+// and descriptor.\n+func (sd *storeDetail) markAlive(foundAliveOn time.Time, storeDesc proto.StoreDescriptor) {\n+\tsd.desc = storeDesc\n+\tsd.dead = false\n+\tsd.lastUpdatedTime = foundAliveOn\n+}\n+\n+// storePoolPQ implements the heap.Interface (which includes  sort.Interface)\n+// and holds storeDetail.\n+type storePoolPQ []*storeDetail\n+\n+// Len implements the sort.Interface.\n+func (pq storePoolPQ) Len() int {\n+\treturn len(pq)\n+}\n+\n+// Less implements the sort.Interface.\n+func (pq storePoolPQ) Less(i, j int) bool {\n+\treturn pq[i].lastUpdatedTime.UnixNano() < pq[j].lastUpdatedTime.UnixNano()\n+}\n+\n+// Swap implements the sort.Interface.\n+func (pq storePoolPQ) Swap(i, j int) {\n+\tpq[i], pq[j] = pq[j], pq[i]\n+\tpq[i].index, pq[j].index = i, j\n+}\n+\n+// Push implements the heap.Interface.\n+func (pq *storePoolPQ) Push(x interface{}) {\n+\tn := len(*pq)\n+\titem := x.(*storeDetail)\n+\titem.index = n\n+\t*pq = append(*pq, item)\n+}\n+\n+// Pop implements the heap.Interface.\n+func (pq *storePoolPQ) Pop() interface{} {\n+\told := *pq\n+\tn := len(old)\n+\titem := old[n-1]\n+\titem.index = -1 // for safety\n+\t*pq = old[0 : n-1]\n+\treturn item\n+}\n+\n+// peek returns the next value in the priority queue without dequeuing it.\n+// Lock is assumed held by caller.\n+func (pq *storePoolPQ) peek() *storeDetail {\n+\tif len(*pq) == 0 {\n+\t\treturn nil\n+\t}\n+\tdetail := (*pq)[0]\n+\treturn detail\n+}\n+\n+// enqueue either adds the detail to the queue or updates its location in the\n+// priority queue.\n+// Lock is assumed held by caller.\n+func (pq *storePoolPQ) enqueue(detail *storeDetail) {\n+\tif detail.index < 0 {\n+\t\theap.Push(pq, detail)\n+\t} else {\n+\t\theap.Fix(pq, detail.index)\n+\t}\n+}\n+\n+// dequeue removes the next detail from the priority queue.\n+// Lock is assumed help by the caller.\n+func (pq *storePoolPQ) dequeue() *storeDetail {\n+\tif len(*pq) == 0 {\n+\t\treturn nil\n+\t}\n+\tdetail := heap.Pop(pq).(*storeDetail)\n+\treturn detail\n+}\n+\n+// StorePool maintains a list of all known stores in the cluster and\n+// information on their health.\n+type StorePool struct {\n+\tgossip             *gossip.Gossip\n+\tclock              *hlc.Clock\n+\ttimeUntilStoreDead time.Duration\n+\n+\tmu     sync.RWMutex // Protects variables below...\n+\tstores map[proto.StoreID]*storeDetail\n+\tqueue  storePoolPQ\n+}\n+\n+// NewStorePool creates a StorePool and registers the store updating callback\n+// with gossip.\n+func NewStorePool(g *gossip.Gossip, timeUntilStoreDead time.Duration, stopper *stop.Stopper) *StorePool {\n+\tsp := &StorePool{\n+\t\ttimeUntilStoreDead: timeUntilStoreDead,\n+\t\tstores:             make(map[proto.StoreID]*storeDetail),\n+\t}\n+\theap.Init(&sp.queue)\n+\n+\tstoreRegex := gossip.MakePrefixPattern(gossip.KeyStorePrefix)\n+\tg.RegisterCallback(storeRegex, sp.storeGossipUpdate)\n+\n+\tsp.start(stopper)\n+\n+\treturn sp\n+}\n+\n+// storeGossipUpdate The gossip callback used to keep the StorePool up to date.\n+func (sp *StorePool) storeGossipUpdate(_ string, content []byte) {\n+\tstoreDesc := new(proto.StoreDescriptor)\n+\tif err := gogoproto.Unmarshal(content, storeDesc); err != nil {\n+\t\tlog.Error(err)\n+\t\treturn\n+\t}\n+\n+\tsp.mu.Lock()\n+\tdefer sp.mu.Unlock()\n+\t// Does this storeDetail exist yet?\n+\tif detail, ok := sp.stores[storeDesc.StoreID]; ok {\n+\t\tdetail.markAlive(time.Now(), *storeDesc)\n+\t\tsp.queue.enqueue(detail)\n+\t} else {\n+\t\tnewDetail := &storeDetail{\n+\t\t\tdesc:            *storeDesc,\n+\t\t\tdead:            false,\n+\t\t\tlastUpdatedTime: time.Now(),\n+\t\t\tindex:           -1, // to ensure this gets added to the queue\n+\t\t}\n+\t\tsp.stores[storeDesc.StoreID] = newDetail\n+\t\tsp.queue.enqueue(newDetail)\n+\t}\n+}\n+\n+// start will run continuously and mark stores as offline if they haven't been\n+// heard from in longer than timeUntilStoreDead.\n+func (sp *StorePool) start(stopper *stop.Stopper) {\n+\tstopper.RunWorker(func() {\n+\t\tfor {\n+\t\t\tvar timeout time.Duration\n+\t\t\tsp.mu.RLock()\n+\t\t\tdetail := sp.queue.peek()\n+\t\t\tif detail == nil {\n+\t\t\t\t// No stores yet, wait the full timeout.\n+\t\t\t\ttimeout = sp.timeUntilStoreDead\n+\t\t\t} else {\n+\t\t\t\tnextAwakeTime := detail.lastUpdatedTime.Add(sp.timeUntilStoreDead)\n+\t\t\t\ttimeout = nextAwakeTime.Sub(time.Now())\n+\t\t\t}\n+\t\t\tsp.mu.RUnlock()\n+\t\t\tselect {\n+\t\t\tcase <-time.After(timeout):\n+\t\t\t\tsp.mu.Lock()\n+\t\t\t\tnextDetail := sp.queue.peek()\n+\t\t\t\tfor nextDetail != nil {","path":"storage/store_pool.go","position":214,"original_position":214,"commit_id":"eceba019b2db5477b0f8625b676f6b26729b962d","original_commit_id":"eceba019b2db5477b0f8625b676f6b26729b962d","user":{"login":"bdarnell","id":160562,"avatar_url":"https://avatars.githubusercontent.com/u/160562?v=3","gravatar_id":"","url":"https://api.github.com/users/bdarnell","html_url":"https://github.com/bdarnell","followers_url":"https://api.github.com/users/bdarnell/followers","following_url":"https://api.github.com/users/bdarnell/following{/other_user}","gists_url":"https://api.github.com/users/bdarnell/gists{/gist_id}","starred_url":"https://api.github.com/users/bdarnell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bdarnell/subscriptions","organizations_url":"https://api.github.com/users/bdarnell/orgs","repos_url":"https://api.github.com/users/bdarnell/repos","events_url":"https://api.github.com/users/bdarnell/events{/privacy}","received_events_url":"https://api.github.com/users/bdarnell/received_events","type":"User","site_admin":false},"body":"This loop needs a break after it reaches a live store (since every store after that will be live too). But I think this whole function could be simplified to remove the nested loop:\r\n\r\n    for {\r\n        var nextTimeout time.Duration\r\n        sp.mu.Lock()\r\n        detail := sp.queue.peek()\r\n        if detail == nil {\r\n            nextTimeout = sp.timeUntilStoreDead\r\n        } else if /*detail is dead */ {\r\n            // mark as dead, dequeue. nextTimeout is 0 so we check the next one immediately.\r\n        } else {\r\n            // detail is alive. schedule next check\r\n            nextTimeout = detail.lastUpdateTime.Add(sp.timeUntilStoreDead)\r\n        }\r\n        sp.mu.Unlock()\r\n        <-time.After(nextTtimeout)  // in a select w/stopper","created_at":"2015-08-29T13:27:23Z","updated_at":"2015-08-29T13:27:23Z","html_url":"https://github.com/cockroachdb/cockroach/pull/2286#discussion_r38261988","pull_request_url":"https://api.github.com/repos/cockroachdb/cockroach/pulls/2286","_links":{"self":{"href":"https://api.github.com/repos/cockroachdb/cockroach/pulls/comments/38261988"},"html":{"href":"https://github.com/cockroachdb/cockroach/pull/2286#discussion_r38261988"},"pull_request":{"href":"https://api.github.com/repos/cockroachdb/cockroach/pulls/2286"}}},"pull_request":{"url":"https://api.github.com/repos/cockroachdb/cockroach/pulls/2286","id":43578189,"html_url":"https://github.com/cockroachdb/cockroach/pull/2286","diff_url":"https://github.com/cockroachdb/cockroach/pull/2286.diff","patch_url":"https://github.com/cockroachdb/cockroach/pull/2286.patch","issue_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/2286","number":2286,"state":"open","locked":false,"title":"Adds StorePool","user":{"login":"BramGruneir","id":1614265,"avatar_url":"https://avatars.githubusercontent.com/u/1614265?v=3","gravatar_id":"","url":"https://api.github.com/users/BramGruneir","html_url":"https://github.com/BramGruneir","followers_url":"https://api.github.com/users/BramGruneir/followers","following_url":"https://api.github.com/users/BramGruneir/following{/other_user}","gists_url":"https://api.github.com/users/BramGruneir/gists{/gist_id}","starred_url":"https://api.github.com/users/BramGruneir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BramGruneir/subscriptions","organizations_url":"https://api.github.com/users/BramGruneir/orgs","repos_url":"https://api.github.com/users/BramGruneir/repos","events_url":"https://api.github.com/users/BramGruneir/events{/privacy}","received_events_url":"https://api.github.com/users/BramGruneir/received_events","type":"User","site_admin":false},"body":"StorePool will keep a list of alive/dead nodes as per the RPC from #2191\r\nThe allocator uses StorePool to ensure that the stores being picked are indeed alive.\r\n\r\nNext up will be:\r\n- get the scanner to sniff out replicas on failed stores\r\n\r\n","created_at":"2015-08-27T23:17:01Z","updated_at":"2015-08-29T13:27:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7835945178e204463b62c0863efee32e2a1020b2","assignee":{"login":"mrtracy","id":6969858,"avatar_url":"https://avatars.githubusercontent.com/u/6969858?v=3","gravatar_id":"","url":"https://api.github.com/users/mrtracy","html_url":"https://github.com/mrtracy","followers_url":"https://api.github.com/users/mrtracy/followers","following_url":"https://api.github.com/users/mrtracy/following{/other_user}","gists_url":"https://api.github.com/users/mrtracy/gists{/gist_id}","starred_url":"https://api.github.com/users/mrtracy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrtracy/subscriptions","organizations_url":"https://api.github.com/users/mrtracy/orgs","repos_url":"https://api.github.com/users/mrtracy/repos","events_url":"https://api.github.com/users/mrtracy/events{/privacy}","received_events_url":"https://api.github.com/users/mrtracy/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/cockroachdb/cockroach/pulls/2286/commits","review_comments_url":"https://api.github.com/repos/cockroachdb/cockroach/pulls/2286/comments","review_comment_url":"https://api.github.com/repos/cockroachdb/cockroach/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/2286/comments","statuses_url":"https://api.github.com/repos/cockroachdb/cockroach/statuses/eceba019b2db5477b0f8625b676f6b26729b962d","head":{"label":"cockroachdb:bram/store-pool","ref":"bram/store-pool","sha":"eceba019b2db5477b0f8625b676f6b26729b962d","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-08-29T07:22:44Z","pushed_at":"2015-08-29T12:37:35Z","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":52476,"stargazers_count":5060,"watchers_count":5060,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":400,"mirror_url":null,"open_issues_count":150,"forks":400,"open_issues":150,"watchers":5060,"default_branch":"master"}},"base":{"label":"cockroachdb:master","ref":"master","sha":"52892743f095b8dc4d94ee61e7b72d04da01bc69","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-08-29T07:22:44Z","pushed_at":"2015-08-29T12:37:35Z","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":52476,"stargazers_count":5060,"watchers_count":5060,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":400,"mirror_url":null,"open_issues_count":150,"forks":400,"open_issues":150,"watchers":5060,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cockroachdb/cockroach/pulls/2286"},"html":{"href":"https://github.com/cockroachdb/cockroach/pull/2286"},"issue":{"href":"https://api.github.com/repos/cockroachdb/cockroach/issues/2286"},"comments":{"href":"https://api.github.com/repos/cockroachdb/cockroach/issues/2286/comments"},"review_comments":{"href":"https://api.github.com/repos/cockroachdb/cockroach/pulls/2286/comments"},"review_comment":{"href":"https://api.github.com/repos/cockroachdb/cockroach/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cockroachdb/cockroach/pulls/2286/commits"},"statuses":{"href":"https://api.github.com/repos/cockroachdb/cockroach/statuses/eceba019b2db5477b0f8625b676f6b26729b962d"}}}}