{"action":"created","comment":{"url":"https://api.github.com/repos/facebook/rocksdb/pulls/comments/196295995","pull_request_review_id":129819377,"id":196295995,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5NjI5NTk5NQ==","diff_hunk":"@@ -606,24 +614,6 @@ class WritePreparedTxnDB : public PessimisticTransactionDB {\n   std::shared_ptr<std::map<uint32_t, ColumnFamilyHandle*>> handle_map_;\n };\n \n-class WritePreparedTxnReadCallback : public ReadCallback {","path":"utilities/transactions/write_prepared_txn_db.h","position":19,"original_position":19,"commit_id":"ee50f9112dd33bae6521b7933f629df601935193","original_commit_id":"ee50f9112dd33bae6521b7933f629df601935193","user":{"login":"lth","id":292656,"node_id":"MDQ6VXNlcjI5MjY1Ng==","avatar_url":"https://avatars1.githubusercontent.com/u/292656?v=4","gravatar_id":"","url":"https://api.github.com/users/lth","html_url":"https://github.com/lth","followers_url":"https://api.github.com/users/lth/followers","following_url":"https://api.github.com/users/lth/following{/other_user}","gists_url":"https://api.github.com/users/lth/gists{/gist_id}","starred_url":"https://api.github.com/users/lth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lth/subscriptions","organizations_url":"https://api.github.com/users/lth/orgs","repos_url":"https://api.github.com/users/lth/repos","events_url":"https://api.github.com/users/lth/events{/privacy}","received_events_url":"https://api.github.com/users/lth/received_events","type":"User","site_admin":false},"body":"This is so that I can embed this object onto the WritePreparedTxn.\r\n\r\nStrictly speaking, embedding only makes sense for write unprepared, since we need to access `txn->unprep_seq_` to correctly execute the read callback. However, I've done it for write prepared as well so that we can reuse more code.","created_at":"2018-06-19T05:12:48Z","updated_at":"2018-06-19T05:12:48Z","html_url":"https://github.com/facebook/rocksdb/pull/3955#discussion_r196295995","pull_request_url":"https://api.github.com/repos/facebook/rocksdb/pulls/3955","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/facebook/rocksdb/pulls/comments/196295995"},"html":{"href":"https://github.com/facebook/rocksdb/pull/3955#discussion_r196295995"},"pull_request":{"href":"https://api.github.com/repos/facebook/rocksdb/pulls/3955"}},"in_reply_to_id":196242737},"pull_request":{"url":"https://api.github.com/repos/facebook/rocksdb/pulls/3955","id":192780363,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkyNzgwMzYz","html_url":"https://github.com/facebook/rocksdb/pull/3955","diff_url":"https://github.com/facebook/rocksdb/pull/3955.diff","patch_url":"https://github.com/facebook/rocksdb/pull/3955.patch","issue_url":"https://api.github.com/repos/facebook/rocksdb/issues/3955","number":3955,"state":"open","locked":false,"title":"Disable seek to snapshot optimization for write unprepared","user":{"login":"lth","id":292656,"node_id":"MDQ6VXNlcjI5MjY1Ng==","avatar_url":"https://avatars1.githubusercontent.com/u/292656?v=4","gravatar_id":"","url":"https://api.github.com/users/lth","html_url":"https://github.com/lth","followers_url":"https://api.github.com/users/lth/followers","following_url":"https://api.github.com/users/lth/following{/other_user}","gists_url":"https://api.github.com/users/lth/gists{/gist_id}","starred_url":"https://api.github.com/users/lth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lth/subscriptions","organizations_url":"https://api.github.com/users/lth/orgs","repos_url":"https://api.github.com/users/lth/repos","events_url":"https://api.github.com/users/lth/events{/privacy}","received_events_url":"https://api.github.com/users/lth/received_events","type":"User","site_admin":false},"body":"This is implemented by extending ReadCallback with another function `MaxVisibleSequenceNumber` which returns the largest visible sequence number for the current transaction, if there is uncommitted data written to DB. Otherwise, it returns zero, indicating no uncommitted data.\r\n\r\nThere are the places where reads had to be modified.\r\n- Get and Seek/Next was just updated to seek to max(snapshot_seq, MaxVisibleSequenceNumber()) instead, and iterate until a key was visible.\r\n- Prev did not need need updates since it did not use the Seek to sequence number optimization. Assuming that locks were held when written unprepared keys, and ValidateSnapshot runs, there should only be committed keys and unprepared keys, all of which are visible. Prev will simply iterate to get the last visible key.\r\n- Reseeking to skip keys optimization was also disabled for write unprepared, since it's possible to hit the max_skip condition even while reseeking. There needs to be some way to resolve infinite looping in this case.","created_at":"2018-06-05T17:22:57Z","updated_at":"2018-06-19T05:12:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d632f62e8050c6395dd7c71ed7a7ceb80350eab5","assignee":null,"assignees":[],"requested_reviewers":[{"login":"yiwu-arbug","id":2606959,"node_id":"MDQ6VXNlcjI2MDY5NTk=","avatar_url":"https://avatars3.githubusercontent.com/u/2606959?v=4","gravatar_id":"","url":"https://api.github.com/users/yiwu-arbug","html_url":"https://github.com/yiwu-arbug","followers_url":"https://api.github.com/users/yiwu-arbug/followers","following_url":"https://api.github.com/users/yiwu-arbug/following{/other_user}","gists_url":"https://api.github.com/users/yiwu-arbug/gists{/gist_id}","starred_url":"https://api.github.com/users/yiwu-arbug/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yiwu-arbug/subscriptions","organizations_url":"https://api.github.com/users/yiwu-arbug/orgs","repos_url":"https://api.github.com/users/yiwu-arbug/repos","events_url":"https://api.github.com/users/yiwu-arbug/events{/privacy}","received_events_url":"https://api.github.com/users/yiwu-arbug/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":196859108,"node_id":"MDU6TGFiZWwxOTY4NTkxMDg=","url":"https://api.github.com/repos/facebook/rocksdb/labels/CLA%20Signed","name":"CLA Signed","color":"009900","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/facebook/rocksdb/pulls/3955/commits","review_comments_url":"https://api.github.com/repos/facebook/rocksdb/pulls/3955/comments","review_comment_url":"https://api.github.com/repos/facebook/rocksdb/pulls/comments{/number}","comments_url":"https://api.github.com/repos/facebook/rocksdb/issues/3955/comments","statuses_url":"https://api.github.com/repos/facebook/rocksdb/statuses/ee50f9112dd33bae6521b7933f629df601935193","head":{"label":"lth:read_own_writes","ref":"read_own_writes","sha":"ee50f9112dd33bae6521b7933f629df601935193","user":{"login":"lth","id":292656,"node_id":"MDQ6VXNlcjI5MjY1Ng==","avatar_url":"https://avatars1.githubusercontent.com/u/292656?v=4","gravatar_id":"","url":"https://api.github.com/users/lth","html_url":"https://github.com/lth","followers_url":"https://api.github.com/users/lth/followers","following_url":"https://api.github.com/users/lth/following{/other_user}","gists_url":"https://api.github.com/users/lth/gists{/gist_id}","starred_url":"https://api.github.com/users/lth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lth/subscriptions","organizations_url":"https://api.github.com/users/lth/orgs","repos_url":"https://api.github.com/users/lth/repos","events_url":"https://api.github.com/users/lth/events{/privacy}","received_events_url":"https://api.github.com/users/lth/received_events","type":"User","site_admin":false},"repo":{"id":73871961,"node_id":"MDEwOlJlcG9zaXRvcnk3Mzg3MTk2MQ==","name":"rocksdb","full_name":"lth/rocksdb","owner":{"login":"lth","id":292656,"node_id":"MDQ6VXNlcjI5MjY1Ng==","avatar_url":"https://avatars1.githubusercontent.com/u/292656?v=4","gravatar_id":"","url":"https://api.github.com/users/lth","html_url":"https://github.com/lth","followers_url":"https://api.github.com/users/lth/followers","following_url":"https://api.github.com/users/lth/following{/other_user}","gists_url":"https://api.github.com/users/lth/gists{/gist_id}","starred_url":"https://api.github.com/users/lth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lth/subscriptions","organizations_url":"https://api.github.com/users/lth/orgs","repos_url":"https://api.github.com/users/lth/repos","events_url":"https://api.github.com/users/lth/events{/privacy}","received_events_url":"https://api.github.com/users/lth/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lth/rocksdb","description":"A library that provides an embeddable, persistent key-value store for fast storage.","fork":true,"url":"https://api.github.com/repos/lth/rocksdb","forks_url":"https://api.github.com/repos/lth/rocksdb/forks","keys_url":"https://api.github.com/repos/lth/rocksdb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lth/rocksdb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lth/rocksdb/teams","hooks_url":"https://api.github.com/repos/lth/rocksdb/hooks","issue_events_url":"https://api.github.com/repos/lth/rocksdb/issues/events{/number}","events_url":"https://api.github.com/repos/lth/rocksdb/events","assignees_url":"https://api.github.com/repos/lth/rocksdb/assignees{/user}","branches_url":"https://api.github.com/repos/lth/rocksdb/branches{/branch}","tags_url":"https://api.github.com/repos/lth/rocksdb/tags","blobs_url":"https://api.github.com/repos/lth/rocksdb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lth/rocksdb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lth/rocksdb/git/refs{/sha}","trees_url":"https://api.github.com/repos/lth/rocksdb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lth/rocksdb/statuses/{sha}","languages_url":"https://api.github.com/repos/lth/rocksdb/languages","stargazers_url":"https://api.github.com/repos/lth/rocksdb/stargazers","contributors_url":"https://api.github.com/repos/lth/rocksdb/contributors","subscribers_url":"https://api.github.com/repos/lth/rocksdb/subscribers","subscription_url":"https://api.github.com/repos/lth/rocksdb/subscription","commits_url":"https://api.github.com/repos/lth/rocksdb/commits{/sha}","git_commits_url":"https://api.github.com/repos/lth/rocksdb/git/commits{/sha}","comments_url":"https://api.github.com/repos/lth/rocksdb/comments{/number}","issue_comment_url":"https://api.github.com/repos/lth/rocksdb/issues/comments{/number}","contents_url":"https://api.github.com/repos/lth/rocksdb/contents/{+path}","compare_url":"https://api.github.com/repos/lth/rocksdb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lth/rocksdb/merges","archive_url":"https://api.github.com/repos/lth/rocksdb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lth/rocksdb/downloads","issues_url":"https://api.github.com/repos/lth/rocksdb/issues{/number}","pulls_url":"https://api.github.com/repos/lth/rocksdb/pulls{/number}","milestones_url":"https://api.github.com/repos/lth/rocksdb/milestones{/number}","notifications_url":"https://api.github.com/repos/lth/rocksdb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lth/rocksdb/labels{/name}","releases_url":"https://api.github.com/repos/lth/rocksdb/releases{/id}","deployments_url":"https://api.github.com/repos/lth/rocksdb/deployments","created_at":"2016-11-16T01:38:32Z","updated_at":"2016-11-16T01:38:38Z","pushed_at":"2018-06-15T20:46:32Z","git_url":"git://github.com/lth/rocksdb.git","ssh_url":"git@github.com:lth/rocksdb.git","clone_url":"https://github.com/lth/rocksdb.git","svn_url":"https://github.com/lth/rocksdb","homepage":"http://rocksdb.org","size":112296,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"facebook:master","ref":"master","sha":"f5281a53a448ac4daecfd7d4ad690a5a71de6dd6","user":{"login":"facebook","id":69631,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY5NjMx","avatar_url":"https://avatars3.githubusercontent.com/u/69631?v=4","gravatar_id":"","url":"https://api.github.com/users/facebook","html_url":"https://github.com/facebook","followers_url":"https://api.github.com/users/facebook/followers","following_url":"https://api.github.com/users/facebook/following{/other_user}","gists_url":"https://api.github.com/users/facebook/gists{/gist_id}","starred_url":"https://api.github.com/users/facebook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facebook/subscriptions","organizations_url":"https://api.github.com/users/facebook/orgs","repos_url":"https://api.github.com/users/facebook/repos","events_url":"https://api.github.com/users/facebook/events{/privacy}","received_events_url":"https://api.github.com/users/facebook/received_events","type":"Organization","site_admin":false},"repo":{"id":6934395,"node_id":"MDEwOlJlcG9zaXRvcnk2OTM0Mzk1","name":"rocksdb","full_name":"facebook/rocksdb","owner":{"login":"facebook","id":69631,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY5NjMx","avatar_url":"https://avatars3.githubusercontent.com/u/69631?v=4","gravatar_id":"","url":"https://api.github.com/users/facebook","html_url":"https://github.com/facebook","followers_url":"https://api.github.com/users/facebook/followers","following_url":"https://api.github.com/users/facebook/following{/other_user}","gists_url":"https://api.github.com/users/facebook/gists{/gist_id}","starred_url":"https://api.github.com/users/facebook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facebook/subscriptions","organizations_url":"https://api.github.com/users/facebook/orgs","repos_url":"https://api.github.com/users/facebook/repos","events_url":"https://api.github.com/users/facebook/events{/privacy}","received_events_url":"https://api.github.com/users/facebook/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/facebook/rocksdb","description":"A library that provides an embeddable, persistent key-value store for fast storage.","fork":false,"url":"https://api.github.com/repos/facebook/rocksdb","forks_url":"https://api.github.com/repos/facebook/rocksdb/forks","keys_url":"https://api.github.com/repos/facebook/rocksdb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/facebook/rocksdb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/facebook/rocksdb/teams","hooks_url":"https://api.github.com/repos/facebook/rocksdb/hooks","issue_events_url":"https://api.github.com/repos/facebook/rocksdb/issues/events{/number}","events_url":"https://api.github.com/repos/facebook/rocksdb/events","assignees_url":"https://api.github.com/repos/facebook/rocksdb/assignees{/user}","branches_url":"https://api.github.com/repos/facebook/rocksdb/branches{/branch}","tags_url":"https://api.github.com/repos/facebook/rocksdb/tags","blobs_url":"https://api.github.com/repos/facebook/rocksdb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/facebook/rocksdb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/facebook/rocksdb/git/refs{/sha}","trees_url":"https://api.github.com/repos/facebook/rocksdb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/facebook/rocksdb/statuses/{sha}","languages_url":"https://api.github.com/repos/facebook/rocksdb/languages","stargazers_url":"https://api.github.com/repos/facebook/rocksdb/stargazers","contributors_url":"https://api.github.com/repos/facebook/rocksdb/contributors","subscribers_url":"https://api.github.com/repos/facebook/rocksdb/subscribers","subscription_url":"https://api.github.com/repos/facebook/rocksdb/subscription","commits_url":"https://api.github.com/repos/facebook/rocksdb/commits{/sha}","git_commits_url":"https://api.github.com/repos/facebook/rocksdb/git/commits{/sha}","comments_url":"https://api.github.com/repos/facebook/rocksdb/comments{/number}","issue_comment_url":"https://api.github.com/repos/facebook/rocksdb/issues/comments{/number}","contents_url":"https://api.github.com/repos/facebook/rocksdb/contents/{+path}","compare_url":"https://api.github.com/repos/facebook/rocksdb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/facebook/rocksdb/merges","archive_url":"https://api.github.com/repos/facebook/rocksdb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/facebook/rocksdb/downloads","issues_url":"https://api.github.com/repos/facebook/rocksdb/issues{/number}","pulls_url":"https://api.github.com/repos/facebook/rocksdb/pulls{/number}","milestones_url":"https://api.github.com/repos/facebook/rocksdb/milestones{/number}","notifications_url":"https://api.github.com/repos/facebook/rocksdb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/facebook/rocksdb/labels{/name}","releases_url":"https://api.github.com/repos/facebook/rocksdb/releases{/id}","deployments_url":"https://api.github.com/repos/facebook/rocksdb/deployments","created_at":"2012-11-30T06:16:18Z","updated_at":"2018-06-19T03:09:38Z","pushed_at":"2018-06-19T03:42:05Z","git_url":"git://github.com/facebook/rocksdb.git","ssh_url":"git@github.com:facebook/rocksdb.git","clone_url":"https://github.com/facebook/rocksdb.git","svn_url":"https://github.com/facebook/rocksdb","homepage":"http://rocksdb.org","size":114833,"stargazers_count":10788,"watchers_count":10788,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":2368,"mirror_url":null,"archived":false,"open_issues_count":219,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":2368,"open_issues":219,"watchers":10788,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/facebook/rocksdb/pulls/3955"},"html":{"href":"https://github.com/facebook/rocksdb/pull/3955"},"issue":{"href":"https://api.github.com/repos/facebook/rocksdb/issues/3955"},"comments":{"href":"https://api.github.com/repos/facebook/rocksdb/issues/3955/comments"},"review_comments":{"href":"https://api.github.com/repos/facebook/rocksdb/pulls/3955/comments"},"review_comment":{"href":"https://api.github.com/repos/facebook/rocksdb/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/facebook/rocksdb/pulls/3955/commits"},"statuses":{"href":"https://api.github.com/repos/facebook/rocksdb/statuses/ee50f9112dd33bae6521b7933f629df601935193"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"lth"}}