{"action":"created","comment":{"url":"https://api.github.com/repos/percona/percona-server-mongodb/pulls/comments/45759966","id":45759966,"diff_hunk":"@@ -202,6 +231,72 @@ namespace mongo {\n         }\n     }\n \n+    KVDictionary::Cursor *TokuFTDictionary::CreatePrelockedCursorWithRetryAndStartKey(OperationContext *opCtx,\n+                                                                                      const Slice &key,\n+                                                                                      const int direction) const {\n+        const int MAX = 32; // <-- This is a rough guess/maybe maps to threads.","path":"src/mongo/db/storage/tokuft/tokuft_dictionary.cpp","position":60,"original_position":60,"commit_id":"be6d6b6a54adce7377e468207d50a2acf59e2a31","original_commit_id":"be6d6b6a54adce7377e468207d50a2acf59e2a31","user":{"login":"dbpercona","id":9259336,"avatar_url":"https://avatars.githubusercontent.com/u/9259336?v=3","gravatar_id":"","url":"https://api.github.com/users/dbpercona","html_url":"https://github.com/dbpercona","followers_url":"https://api.github.com/users/dbpercona/followers","following_url":"https://api.github.com/users/dbpercona/following{/other_user}","gists_url":"https://api.github.com/users/dbpercona/gists{/gist_id}","starred_url":"https://api.github.com/users/dbpercona/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dbpercona/subscriptions","organizations_url":"https://api.github.com/users/dbpercona/orgs","repos_url":"https://api.github.com/users/dbpercona/repos","events_url":"https://api.github.com/users/dbpercona/events{/privacy}","received_events_url":"https://api.github.com/users/dbpercona/received_events","type":"User","site_admin":false},"body":"Regarding the MAX constants added in toku_dictionary.cpp, this should probably be defined once in toku_dictionary.h with a more descriptive name and use it in both methods. In the future we may decide to make it a configurable parameter.","created_at":"2015-11-24T16:39:03Z","updated_at":"2015-11-24T16:39:03Z","html_url":"https://github.com/percona/percona-server-mongodb/pull/17#discussion_r45759966","pull_request_url":"https://api.github.com/repos/percona/percona-server-mongodb/pulls/17","_links":{"self":{"href":"https://api.github.com/repos/percona/percona-server-mongodb/pulls/comments/45759966"},"html":{"href":"https://github.com/percona/percona-server-mongodb/pull/17#discussion_r45759966"},"pull_request":{"href":"https://api.github.com/repos/percona/percona-server-mongodb/pulls/17"}}},"pull_request":{"url":"https://api.github.com/repos/percona/percona-server-mongodb/pulls/17","id":51611095,"html_url":"https://github.com/percona/percona-server-mongodb/pull/17","diff_url":"https://github.com/percona/percona-server-mongodb/pull/17.diff","patch_url":"https://github.com/percona/percona-server-mongodb/pull/17.patch","issue_url":"https://api.github.com/repos/percona/percona-server-mongodb/issues/17","number":17,"state":"open","locked":false,"title":"Create pre-locked key range FT cursors for some index scans.","user":{"login":"christianrober","id":4181943,"avatar_url":"https://avatars.githubusercontent.com/u/4181943?v=3","gravatar_id":"","url":"https://api.github.com/users/christianrober","html_url":"https://github.com/christianrober","followers_url":"https://api.github.com/users/christianrober/followers","following_url":"https://api.github.com/users/christianrober/following{/other_user}","gists_url":"https://api.github.com/users/christianrober/gists{/gist_id}","starred_url":"https://api.github.com/users/christianrober/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/christianrober/subscriptions","organizations_url":"https://api.github.com/users/christianrober/orgs","repos_url":"https://api.github.com/users/christianrober/repos","events_url":"https://api.github.com/users/christianrober/events{/privacy}","received_events_url":"https://api.github.com/users/christianrober/received_events","type":"User","site_admin":false},"body":"These changes allow the fractal tree storage engine to create cursors that pre-lock a range of keys before they are used/consumed/altered by a write operation. In Read-Modify-Write workloads, like db.collection.update() operations, this will help reduce lock contention and improve concurrency.\r\n\r\nThe high level goal of pre-locking the cursor range is to lock and serialize write access to logical keys before descending deep into the fractal tree, where even more locks will be held. By avoiding this nested locking, other operations will be blocked less by a concurrent write operation.\r\n\r\nNote: Changes to the MongoDB source code were required to enable pre-locking. These primarily include a minor refactoring of index scan initialization and some new key range caching methods added to the operation context classes.","created_at":"2015-11-24T02:52:34Z","updated_at":"2015-11-24T16:39:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4cd4fa48955ee45e36f6f245ba417855142d64cb","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/percona/percona-server-mongodb/pulls/17/commits","review_comments_url":"https://api.github.com/repos/percona/percona-server-mongodb/pulls/17/comments","review_comment_url":"https://api.github.com/repos/percona/percona-server-mongodb/pulls/comments{/number}","comments_url":"https://api.github.com/repos/percona/percona-server-mongodb/issues/17/comments","statuses_url":"https://api.github.com/repos/percona/percona-server-mongodb/statuses/be6d6b6a54adce7377e468207d50a2acf59e2a31","head":{"label":"christianrober:new_write_conflict_retry","ref":"new_write_conflict_retry","sha":"be6d6b6a54adce7377e468207d50a2acf59e2a31","user":{"login":"christianrober","id":4181943,"avatar_url":"https://avatars.githubusercontent.com/u/4181943?v=3","gravatar_id":"","url":"https://api.github.com/users/christianrober","html_url":"https://github.com/christianrober","followers_url":"https://api.github.com/users/christianrober/followers","following_url":"https://api.github.com/users/christianrober/following{/other_user}","gists_url":"https://api.github.com/users/christianrober/gists{/gist_id}","starred_url":"https://api.github.com/users/christianrober/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/christianrober/subscriptions","organizations_url":"https://api.github.com/users/christianrober/orgs","repos_url":"https://api.github.com/users/christianrober/repos","events_url":"https://api.github.com/users/christianrober/events{/privacy}","received_events_url":"https://api.github.com/users/christianrober/received_events","type":"User","site_admin":false},"repo":{"id":40247498,"name":"percona-server-mongodb","full_name":"christianrober/percona-server-mongodb","owner":{"login":"christianrober","id":4181943,"avatar_url":"https://avatars.githubusercontent.com/u/4181943?v=3","gravatar_id":"","url":"https://api.github.com/users/christianrober","html_url":"https://github.com/christianrober","followers_url":"https://api.github.com/users/christianrober/followers","following_url":"https://api.github.com/users/christianrober/following{/other_user}","gists_url":"https://api.github.com/users/christianrober/gists{/gist_id}","starred_url":"https://api.github.com/users/christianrober/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/christianrober/subscriptions","organizations_url":"https://api.github.com/users/christianrober/orgs","repos_url":"https://api.github.com/users/christianrober/repos","events_url":"https://api.github.com/users/christianrober/events{/privacy}","received_events_url":"https://api.github.com/users/christianrober/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/christianrober/percona-server-mongodb","description":"Percona Server for MongoDB","fork":true,"url":"https://api.github.com/repos/christianrober/percona-server-mongodb","forks_url":"https://api.github.com/repos/christianrober/percona-server-mongodb/forks","keys_url":"https://api.github.com/repos/christianrober/percona-server-mongodb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/christianrober/percona-server-mongodb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/christianrober/percona-server-mongodb/teams","hooks_url":"https://api.github.com/repos/christianrober/percona-server-mongodb/hooks","issue_events_url":"https://api.github.com/repos/christianrober/percona-server-mongodb/issues/events{/number}","events_url":"https://api.github.com/repos/christianrober/percona-server-mongodb/events","assignees_url":"https://api.github.com/repos/christianrober/percona-server-mongodb/assignees{/user}","branches_url":"https://api.github.com/repos/christianrober/percona-server-mongodb/branches{/branch}","tags_url":"https://api.github.com/repos/christianrober/percona-server-mongodb/tags","blobs_url":"https://api.github.com/repos/christianrober/percona-server-mongodb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/christianrober/percona-server-mongodb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/christianrober/percona-server-mongodb/git/refs{/sha}","trees_url":"https://api.github.com/repos/christianrober/percona-server-mongodb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/christianrober/percona-server-mongodb/statuses/{sha}","languages_url":"https://api.github.com/repos/christianrober/percona-server-mongodb/languages","stargazers_url":"https://api.github.com/repos/christianrober/percona-server-mongodb/stargazers","contributors_url":"https://api.github.com/repos/christianrober/percona-server-mongodb/contributors","subscribers_url":"https://api.github.com/repos/christianrober/percona-server-mongodb/subscribers","subscription_url":"https://api.github.com/repos/christianrober/percona-server-mongodb/subscription","commits_url":"https://api.github.com/repos/christianrober/percona-server-mongodb/commits{/sha}","git_commits_url":"https://api.github.com/repos/christianrober/percona-server-mongodb/git/commits{/sha}","comments_url":"https://api.github.com/repos/christianrober/percona-server-mongodb/comments{/number}","issue_comment_url":"https://api.github.com/repos/christianrober/percona-server-mongodb/issues/comments{/number}","contents_url":"https://api.github.com/repos/christianrober/percona-server-mongodb/contents/{+path}","compare_url":"https://api.github.com/repos/christianrober/percona-server-mongodb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/christianrober/percona-server-mongodb/merges","archive_url":"https://api.github.com/repos/christianrober/percona-server-mongodb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/christianrober/percona-server-mongodb/downloads","issues_url":"https://api.github.com/repos/christianrober/percona-server-mongodb/issues{/number}","pulls_url":"https://api.github.com/repos/christianrober/percona-server-mongodb/pulls{/number}","milestones_url":"https://api.github.com/repos/christianrober/percona-server-mongodb/milestones{/number}","notifications_url":"https://api.github.com/repos/christianrober/percona-server-mongodb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/christianrober/percona-server-mongodb/labels{/name}","releases_url":"https://api.github.com/repos/christianrober/percona-server-mongodb/releases{/id}","created_at":"2015-08-05T13:43:49Z","updated_at":"2015-08-05T13:44:05Z","pushed_at":"2015-11-24T00:28:48Z","git_url":"git://github.com/christianrober/percona-server-mongodb.git","ssh_url":"git@github.com:christianrober/percona-server-mongodb.git","clone_url":"https://github.com/christianrober/percona-server-mongodb.git","svn_url":"https://github.com/christianrober/percona-server-mongodb","homepage":"http://www.percona.com","size":171946,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"percona:v3.0","ref":"v3.0","sha":"5c6038972803da68bf2aa120ecf13cb66cf32d4f","user":{"login":"percona","id":1683025,"avatar_url":"https://avatars.githubusercontent.com/u/1683025?v=3","gravatar_id":"","url":"https://api.github.com/users/percona","html_url":"https://github.com/percona","followers_url":"https://api.github.com/users/percona/followers","following_url":"https://api.github.com/users/percona/following{/other_user}","gists_url":"https://api.github.com/users/percona/gists{/gist_id}","starred_url":"https://api.github.com/users/percona/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/percona/subscriptions","organizations_url":"https://api.github.com/users/percona/orgs","repos_url":"https://api.github.com/users/percona/repos","events_url":"https://api.github.com/users/percona/events{/privacy}","received_events_url":"https://api.github.com/users/percona/received_events","type":"Organization","site_admin":false},"repo":{"id":39519916,"name":"percona-server-mongodb","full_name":"percona/percona-server-mongodb","owner":{"login":"percona","id":1683025,"avatar_url":"https://avatars.githubusercontent.com/u/1683025?v=3","gravatar_id":"","url":"https://api.github.com/users/percona","html_url":"https://github.com/percona","followers_url":"https://api.github.com/users/percona/followers","following_url":"https://api.github.com/users/percona/following{/other_user}","gists_url":"https://api.github.com/users/percona/gists{/gist_id}","starred_url":"https://api.github.com/users/percona/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/percona/subscriptions","organizations_url":"https://api.github.com/users/percona/orgs","repos_url":"https://api.github.com/users/percona/repos","events_url":"https://api.github.com/users/percona/events{/privacy}","received_events_url":"https://api.github.com/users/percona/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/percona/percona-server-mongodb","description":"Percona Server for MongoDB","fork":true,"url":"https://api.github.com/repos/percona/percona-server-mongodb","forks_url":"https://api.github.com/repos/percona/percona-server-mongodb/forks","keys_url":"https://api.github.com/repos/percona/percona-server-mongodb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/percona/percona-server-mongodb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/percona/percona-server-mongodb/teams","hooks_url":"https://api.github.com/repos/percona/percona-server-mongodb/hooks","issue_events_url":"https://api.github.com/repos/percona/percona-server-mongodb/issues/events{/number}","events_url":"https://api.github.com/repos/percona/percona-server-mongodb/events","assignees_url":"https://api.github.com/repos/percona/percona-server-mongodb/assignees{/user}","branches_url":"https://api.github.com/repos/percona/percona-server-mongodb/branches{/branch}","tags_url":"https://api.github.com/repos/percona/percona-server-mongodb/tags","blobs_url":"https://api.github.com/repos/percona/percona-server-mongodb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/percona/percona-server-mongodb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/percona/percona-server-mongodb/git/refs{/sha}","trees_url":"https://api.github.com/repos/percona/percona-server-mongodb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/percona/percona-server-mongodb/statuses/{sha}","languages_url":"https://api.github.com/repos/percona/percona-server-mongodb/languages","stargazers_url":"https://api.github.com/repos/percona/percona-server-mongodb/stargazers","contributors_url":"https://api.github.com/repos/percona/percona-server-mongodb/contributors","subscribers_url":"https://api.github.com/repos/percona/percona-server-mongodb/subscribers","subscription_url":"https://api.github.com/repos/percona/percona-server-mongodb/subscription","commits_url":"https://api.github.com/repos/percona/percona-server-mongodb/commits{/sha}","git_commits_url":"https://api.github.com/repos/percona/percona-server-mongodb/git/commits{/sha}","comments_url":"https://api.github.com/repos/percona/percona-server-mongodb/comments{/number}","issue_comment_url":"https://api.github.com/repos/percona/percona-server-mongodb/issues/comments{/number}","contents_url":"https://api.github.com/repos/percona/percona-server-mongodb/contents/{+path}","compare_url":"https://api.github.com/repos/percona/percona-server-mongodb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/percona/percona-server-mongodb/merges","archive_url":"https://api.github.com/repos/percona/percona-server-mongodb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/percona/percona-server-mongodb/downloads","issues_url":"https://api.github.com/repos/percona/percona-server-mongodb/issues{/number}","pulls_url":"https://api.github.com/repos/percona/percona-server-mongodb/pulls{/number}","milestones_url":"https://api.github.com/repos/percona/percona-server-mongodb/milestones{/number}","notifications_url":"https://api.github.com/repos/percona/percona-server-mongodb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/percona/percona-server-mongodb/labels{/name}","releases_url":"https://api.github.com/repos/percona/percona-server-mongodb/releases{/id}","created_at":"2015-07-22T17:25:26Z","updated_at":"2015-10-23T00:33:24Z","pushed_at":"2015-11-24T02:52:34Z","git_url":"git://github.com/percona/percona-server-mongodb.git","ssh_url":"git@github.com:percona/percona-server-mongodb.git","clone_url":"https://github.com/percona/percona-server-mongodb.git","svn_url":"https://github.com/percona/percona-server-mongodb","homepage":"http://www.percona.com","size":171830,"stargazers_count":7,"watchers_count":7,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"open_issues_count":1,"forks":7,"open_issues":1,"watchers":7,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/percona/percona-server-mongodb/pulls/17"},"html":{"href":"https://github.com/percona/percona-server-mongodb/pull/17"},"issue":{"href":"https://api.github.com/repos/percona/percona-server-mongodb/issues/17"},"comments":{"href":"https://api.github.com/repos/percona/percona-server-mongodb/issues/17/comments"},"review_comments":{"href":"https://api.github.com/repos/percona/percona-server-mongodb/pulls/17/comments"},"review_comment":{"href":"https://api.github.com/repos/percona/percona-server-mongodb/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/percona/percona-server-mongodb/pulls/17/commits"},"statuses":{"href":"https://api.github.com/repos/percona/percona-server-mongodb/statuses/be6d6b6a54adce7377e468207d50a2acf59e2a31"}}}}