{"action":"created","comment":{"url":"https://api.github.com/repos/solana-labs/solana/pulls/comments/259559131","pull_request_review_id":207088287,"id":259559131,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI1OTU1OTEzMQ==","diff_hunk":"@@ -191,39 +191,34 @@ impl ReplayStage {\n         let to_leader_sender = to_leader_sender.clone();\n         let subscriptions_ = subscriptions.clone();\n \n-        let (bank, last_entry_id) = {\n+        let (bank, last_entry_id, mut current_blob_index) = {\n             let mut bank_forks = bank_forks.write().unwrap();\n             bank_forks.set_working_bank_id(bank_forks_info[0].bank_id);\n-            (bank_forks.working_bank(), bank_forks_info[0].last_entry_id)\n+            (\n+                bank_forks.working_bank(),\n+                bank_forks_info[0].last_entry_id,\n+                bank_forks_info[0].entry_height,\n+            )\n         };\n         let last_entry_id = Arc::new(RwLock::new(last_entry_id));\n-\n-        let mut current_blob_index = {\n-            let leader_scheduler = leader_scheduler.read().unwrap();\n-            let slot = leader_scheduler.tick_height_to_slot(bank.tick_height() + 1);\n-\n-            let leader_id = leader_scheduler\n-                .get_leader_for_slot(slot)\n-                .expect(\"Leader not known after processing bank\");\n-            trace!(\"node {:?} scheduled as leader for slot {}\", leader_id, slot,);\n-\n-            // Send a rotation notification back to Fullnode to initialize the TPU to the right\n-            // state\n-            to_leader_sender\n-                .send(TvuRotationInfo {\n-                    bank: Bank::new_from_parent(&bank, &leader_id),\n-                    last_entry_id: *last_entry_id.read().unwrap(),\n-                    slot,\n-                    leader_id,\n-                })\n-                .unwrap();\n-\n-            blocktree\n-                .meta(slot)\n-                .expect(\"Database error\")\n-                .map(|meta| meta.consumed)\n-                .unwrap_or(0)\n-        };\n+        let leader_scheduler = leader_scheduler.read().unwrap();","path":"src/replay_stage.rs","position":43,"original_position":43,"commit_id":"e89dd2373128981db235de583d5c848e33c0099a","original_commit_id":"e89dd2373128981db235de583d5c848e33c0099a","user":{"login":"mvines","id":1281082,"node_id":"MDQ6VXNlcjEyODEwODI=","avatar_url":"https://avatars1.githubusercontent.com/u/1281082?v=4","gravatar_id":"","url":"https://api.github.com/users/mvines","html_url":"https://github.com/mvines","followers_url":"https://api.github.com/users/mvines/followers","following_url":"https://api.github.com/users/mvines/following{/other_user}","gists_url":"https://api.github.com/users/mvines/gists{/gist_id}","starred_url":"https://api.github.com/users/mvines/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mvines/subscriptions","organizations_url":"https://api.github.com/users/mvines/orgs","repos_url":"https://api.github.com/users/mvines/repos","events_url":"https://api.github.com/users/mvines/events{/privacy}","received_events_url":"https://api.github.com/users/mvines/received_events","type":"User","site_admin":false},"body":"oh this also wrapped in a block to release the leader_scheduler read lock","created_at":"2019-02-23T01:47:47Z","updated_at":"2019-02-23T01:47:53Z","html_url":"https://github.com/solana-labs/solana/pull/2913#discussion_r259559131","pull_request_url":"https://api.github.com/repos/solana-labs/solana/pulls/2913","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/solana-labs/solana/pulls/comments/259559131"},"html":{"href":"https://github.com/solana-labs/solana/pull/2913#discussion_r259559131"},"pull_request":{"href":"https://api.github.com/repos/solana-labs/solana/pulls/2913"}}},"pull_request":{"url":"https://api.github.com/repos/solana-labs/solana/pulls/2913","id":255578526,"node_id":"MDExOlB1bGxSZXF1ZXN0MjU1NTc4NTI2","html_url":"https://github.com/solana-labs/solana/pull/2913","diff_url":"https://github.com/solana-labs/solana/pull/2913.diff","patch_url":"https://github.com/solana-labs/solana/pull/2913.patch","issue_url":"https://api.github.com/repos/solana-labs/solana/issues/2913","number":2913,"state":"open","locked":false,"title":"Checking blocktree for entry height is racy in replay_stage","user":{"login":"carllin","id":3374799,"node_id":"MDQ6VXNlcjMzNzQ3OTk=","avatar_url":"https://avatars1.githubusercontent.com/u/3374799?v=4","gravatar_id":"","url":"https://api.github.com/users/carllin","html_url":"https://github.com/carllin","followers_url":"https://api.github.com/users/carllin/followers","following_url":"https://api.github.com/users/carllin/following{/other_user}","gists_url":"https://api.github.com/users/carllin/gists{/gist_id}","starred_url":"https://api.github.com/users/carllin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/carllin/subscriptions","organizations_url":"https://api.github.com/users/carllin/orgs","repos_url":"https://api.github.com/users/carllin/repos","events_url":"https://api.github.com/users/carllin/events{/privacy}","received_events_url":"https://api.github.com/users/carllin/received_events","type":"User","site_admin":false},"body":"#### Problem\r\nChecking Blocktree for entry height is racy in replay_stage, symptoms and root cause described here: https://github.com/solana-labs/solana/issues/2885\r\n\r\n#### Summary of Changes\r\nFix racy check in ReplayStage\r\n\r\nFixes #\r\nhttps://github.com/solana-labs/solana/issues/2885","created_at":"2019-02-23T01:21:36Z","updated_at":"2019-02-23T01:47:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3cc2c3e06600c183da6994deb6c3e0b26be9671a","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/solana-labs/solana/pulls/2913/commits","review_comments_url":"https://api.github.com/repos/solana-labs/solana/pulls/2913/comments","review_comment_url":"https://api.github.com/repos/solana-labs/solana/pulls/comments{/number}","comments_url":"https://api.github.com/repos/solana-labs/solana/issues/2913/comments","statuses_url":"https://api.github.com/repos/solana-labs/solana/statuses/e89dd2373128981db235de583d5c848e33c0099a","head":{"label":"carllin:FixReplayRace","ref":"FixReplayRace","sha":"e89dd2373128981db235de583d5c848e33c0099a","user":{"login":"carllin","id":3374799,"node_id":"MDQ6VXNlcjMzNzQ3OTk=","avatar_url":"https://avatars1.githubusercontent.com/u/3374799?v=4","gravatar_id":"","url":"https://api.github.com/users/carllin","html_url":"https://github.com/carllin","followers_url":"https://api.github.com/users/carllin/followers","following_url":"https://api.github.com/users/carllin/following{/other_user}","gists_url":"https://api.github.com/users/carllin/gists{/gist_id}","starred_url":"https://api.github.com/users/carllin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/carllin/subscriptions","organizations_url":"https://api.github.com/users/carllin/orgs","repos_url":"https://api.github.com/users/carllin/repos","events_url":"https://api.github.com/users/carllin/events{/privacy}","received_events_url":"https://api.github.com/users/carllin/received_events","type":"User","site_admin":false},"repo":{"id":136771278,"node_id":"MDEwOlJlcG9zaXRvcnkxMzY3NzEyNzg=","name":"solana","full_name":"carllin/solana","private":false,"owner":{"login":"carllin","id":3374799,"node_id":"MDQ6VXNlcjMzNzQ3OTk=","avatar_url":"https://avatars1.githubusercontent.com/u/3374799?v=4","gravatar_id":"","url":"https://api.github.com/users/carllin","html_url":"https://github.com/carllin","followers_url":"https://api.github.com/users/carllin/followers","following_url":"https://api.github.com/users/carllin/following{/other_user}","gists_url":"https://api.github.com/users/carllin/gists{/gist_id}","starred_url":"https://api.github.com/users/carllin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/carllin/subscriptions","organizations_url":"https://api.github.com/users/carllin/orgs","repos_url":"https://api.github.com/users/carllin/repos","events_url":"https://api.github.com/users/carllin/events{/privacy}","received_events_url":"https://api.github.com/users/carllin/received_events","type":"User","site_admin":false},"html_url":"https://github.com/carllin/solana","description":"Blockchain, Rebuilt for Scale","fork":true,"url":"https://api.github.com/repos/carllin/solana","forks_url":"https://api.github.com/repos/carllin/solana/forks","keys_url":"https://api.github.com/repos/carllin/solana/keys{/key_id}","collaborators_url":"https://api.github.com/repos/carllin/solana/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/carllin/solana/teams","hooks_url":"https://api.github.com/repos/carllin/solana/hooks","issue_events_url":"https://api.github.com/repos/carllin/solana/issues/events{/number}","events_url":"https://api.github.com/repos/carllin/solana/events","assignees_url":"https://api.github.com/repos/carllin/solana/assignees{/user}","branches_url":"https://api.github.com/repos/carllin/solana/branches{/branch}","tags_url":"https://api.github.com/repos/carllin/solana/tags","blobs_url":"https://api.github.com/repos/carllin/solana/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/carllin/solana/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/carllin/solana/git/refs{/sha}","trees_url":"https://api.github.com/repos/carllin/solana/git/trees{/sha}","statuses_url":"https://api.github.com/repos/carllin/solana/statuses/{sha}","languages_url":"https://api.github.com/repos/carllin/solana/languages","stargazers_url":"https://api.github.com/repos/carllin/solana/stargazers","contributors_url":"https://api.github.com/repos/carllin/solana/contributors","subscribers_url":"https://api.github.com/repos/carllin/solana/subscribers","subscription_url":"https://api.github.com/repos/carllin/solana/subscription","commits_url":"https://api.github.com/repos/carllin/solana/commits{/sha}","git_commits_url":"https://api.github.com/repos/carllin/solana/git/commits{/sha}","comments_url":"https://api.github.com/repos/carllin/solana/comments{/number}","issue_comment_url":"https://api.github.com/repos/carllin/solana/issues/comments{/number}","contents_url":"https://api.github.com/repos/carllin/solana/contents/{+path}","compare_url":"https://api.github.com/repos/carllin/solana/compare/{base}...{head}","merges_url":"https://api.github.com/repos/carllin/solana/merges","archive_url":"https://api.github.com/repos/carllin/solana/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/carllin/solana/downloads","issues_url":"https://api.github.com/repos/carllin/solana/issues{/number}","pulls_url":"https://api.github.com/repos/carllin/solana/pulls{/number}","milestones_url":"https://api.github.com/repos/carllin/solana/milestones{/number}","notifications_url":"https://api.github.com/repos/carllin/solana/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/carllin/solana/labels{/name}","releases_url":"https://api.github.com/repos/carllin/solana/releases{/id}","deployments_url":"https://api.github.com/repos/carllin/solana/deployments","created_at":"2018-06-10T01:50:19Z","updated_at":"2018-09-19T21:33:30Z","pushed_at":"2019-02-23T01:47:24Z","git_url":"git://github.com/carllin/solana.git","ssh_url":"git@github.com:carllin/solana.git","clone_url":"https://github.com/carllin/solana.git","svn_url":"https://github.com/carllin/solana","homepage":"https://solana.com","size":18848,"stargazers_count":0,"watchers_count":0,"language":"Rust","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"solana-labs:master","ref":"master","sha":"0b8809da6efe80fbcbeb8f5d37faeaab997a2c55","user":{"login":"solana-labs","id":35608259,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM1NjA4MjU5","avatar_url":"https://avatars3.githubusercontent.com/u/35608259?v=4","gravatar_id":"","url":"https://api.github.com/users/solana-labs","html_url":"https://github.com/solana-labs","followers_url":"https://api.github.com/users/solana-labs/followers","following_url":"https://api.github.com/users/solana-labs/following{/other_user}","gists_url":"https://api.github.com/users/solana-labs/gists{/gist_id}","starred_url":"https://api.github.com/users/solana-labs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/solana-labs/subscriptions","organizations_url":"https://api.github.com/users/solana-labs/orgs","repos_url":"https://api.github.com/users/solana-labs/repos","events_url":"https://api.github.com/users/solana-labs/events{/privacy}","received_events_url":"https://api.github.com/users/solana-labs/received_events","type":"Organization","site_admin":false},"repo":{"id":121470383,"node_id":"MDEwOlJlcG9zaXRvcnkxMjE0NzAzODM=","name":"solana","full_name":"solana-labs/solana","private":false,"owner":{"login":"solana-labs","id":35608259,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM1NjA4MjU5","avatar_url":"https://avatars3.githubusercontent.com/u/35608259?v=4","gravatar_id":"","url":"https://api.github.com/users/solana-labs","html_url":"https://github.com/solana-labs","followers_url":"https://api.github.com/users/solana-labs/followers","following_url":"https://api.github.com/users/solana-labs/following{/other_user}","gists_url":"https://api.github.com/users/solana-labs/gists{/gist_id}","starred_url":"https://api.github.com/users/solana-labs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/solana-labs/subscriptions","organizations_url":"https://api.github.com/users/solana-labs/orgs","repos_url":"https://api.github.com/users/solana-labs/repos","events_url":"https://api.github.com/users/solana-labs/events{/privacy}","received_events_url":"https://api.github.com/users/solana-labs/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/solana-labs/solana","description":"Blockchain Rebuilt for Scale","fork":false,"url":"https://api.github.com/repos/solana-labs/solana","forks_url":"https://api.github.com/repos/solana-labs/solana/forks","keys_url":"https://api.github.com/repos/solana-labs/solana/keys{/key_id}","collaborators_url":"https://api.github.com/repos/solana-labs/solana/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/solana-labs/solana/teams","hooks_url":"https://api.github.com/repos/solana-labs/solana/hooks","issue_events_url":"https://api.github.com/repos/solana-labs/solana/issues/events{/number}","events_url":"https://api.github.com/repos/solana-labs/solana/events","assignees_url":"https://api.github.com/repos/solana-labs/solana/assignees{/user}","branches_url":"https://api.github.com/repos/solana-labs/solana/branches{/branch}","tags_url":"https://api.github.com/repos/solana-labs/solana/tags","blobs_url":"https://api.github.com/repos/solana-labs/solana/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/solana-labs/solana/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/solana-labs/solana/git/refs{/sha}","trees_url":"https://api.github.com/repos/solana-labs/solana/git/trees{/sha}","statuses_url":"https://api.github.com/repos/solana-labs/solana/statuses/{sha}","languages_url":"https://api.github.com/repos/solana-labs/solana/languages","stargazers_url":"https://api.github.com/repos/solana-labs/solana/stargazers","contributors_url":"https://api.github.com/repos/solana-labs/solana/contributors","subscribers_url":"https://api.github.com/repos/solana-labs/solana/subscribers","subscription_url":"https://api.github.com/repos/solana-labs/solana/subscription","commits_url":"https://api.github.com/repos/solana-labs/solana/commits{/sha}","git_commits_url":"https://api.github.com/repos/solana-labs/solana/git/commits{/sha}","comments_url":"https://api.github.com/repos/solana-labs/solana/comments{/number}","issue_comment_url":"https://api.github.com/repos/solana-labs/solana/issues/comments{/number}","contents_url":"https://api.github.com/repos/solana-labs/solana/contents/{+path}","compare_url":"https://api.github.com/repos/solana-labs/solana/compare/{base}...{head}","merges_url":"https://api.github.com/repos/solana-labs/solana/merges","archive_url":"https://api.github.com/repos/solana-labs/solana/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/solana-labs/solana/downloads","issues_url":"https://api.github.com/repos/solana-labs/solana/issues{/number}","pulls_url":"https://api.github.com/repos/solana-labs/solana/pulls{/number}","milestones_url":"https://api.github.com/repos/solana-labs/solana/milestones{/number}","notifications_url":"https://api.github.com/repos/solana-labs/solana/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/solana-labs/solana/labels{/name}","releases_url":"https://api.github.com/repos/solana-labs/solana/releases{/id}","deployments_url":"https://api.github.com/repos/solana-labs/solana/deployments","created_at":"2018-02-14T04:26:27Z","updated_at":"2019-02-23T00:35:44Z","pushed_at":"2019-02-23T01:47:25Z","git_url":"git://github.com/solana-labs/solana.git","ssh_url":"git@github.com:solana-labs/solana.git","clone_url":"https://github.com/solana-labs/solana.git","svn_url":"https://github.com/solana-labs/solana","homepage":"https://solana.com","size":17830,"stargazers_count":407,"watchers_count":407,"language":"Rust","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":80,"mirror_url":null,"archived":false,"open_issues_count":195,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":80,"open_issues":195,"watchers":407,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/solana-labs/solana/pulls/2913"},"html":{"href":"https://github.com/solana-labs/solana/pull/2913"},"issue":{"href":"https://api.github.com/repos/solana-labs/solana/issues/2913"},"comments":{"href":"https://api.github.com/repos/solana-labs/solana/issues/2913/comments"},"review_comments":{"href":"https://api.github.com/repos/solana-labs/solana/pulls/2913/comments"},"review_comment":{"href":"https://api.github.com/repos/solana-labs/solana/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/solana-labs/solana/pulls/2913/commits"},"statuses":{"href":"https://api.github.com/repos/solana-labs/solana/statuses/e89dd2373128981db235de583d5c848e33c0099a"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"mvines"}}