{"action":"created","comment":{"url":"https://api.github.com/repos/wiredtiger/wiredtiger/pulls/comments/31159023","id":31159023,"diff_hunk":"@@ -31,7 +34,16 @@ __clsm_close_bulk(WT_CURSOR *cursor)\n \tclsm->nchunks = 0;\n \n \t/* Set ondisk, and flush the metadata */\n-\tF_SET(lsm_tree->chunk[0], WT_LSM_CHUNK_ONDISK);\n+\tF_SET(chunk, WT_LSM_CHUNK_ONDISK);\n+\t/*\n+\t * Setup a generation in our chunk, so that future LSM merges choose\n+\t * reasonable sets of chunks.\n+\t */\n+\tavg_chunks = (lsm_tree->merge_min + lsm_tree->merge_max) / 2;\n+\tfor (last_size = avg_chunks * lsm_tree->chunk_size;\n+\t    last_size < chunk->size;\n+\t    last_size *= avg_chunks, ++chunk->generation) {}\n+","path":"src/lsm/lsm_cursor_bulk.c","position":29,"original_position":29,"commit_id":"0b42eab5213d539b9d696a57a93778bde4323b32","original_commit_id":"0b42eab5213d539b9d696a57a93778bde4323b32","user":{"login":"sueloverso","id":2945957,"avatar_url":"https://avatars.githubusercontent.com/u/2945957?v=3","gravatar_id":"","url":"https://api.github.com/users/sueloverso","html_url":"https://github.com/sueloverso","followers_url":"https://api.github.com/users/sueloverso/followers","following_url":"https://api.github.com/users/sueloverso/following{/other_user}","gists_url":"https://api.github.com/users/sueloverso/gists{/gist_id}","starred_url":"https://api.github.com/users/sueloverso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sueloverso/subscriptions","organizations_url":"https://api.github.com/users/sueloverso/orgs","repos_url":"https://api.github.com/users/sueloverso/repos","events_url":"https://api.github.com/users/sueloverso/events{/privacy}","received_events_url":"https://api.github.com/users/sueloverso/received_events","type":"User","site_admin":false},"body":"I find @michaelcahill's suggestion more readable.  I will make that change, test and merge.","created_at":"2015-05-27T17:33:52Z","updated_at":"2015-05-27T17:33:52Z","html_url":"https://github.com/wiredtiger/wiredtiger/pull/1996#discussion_r31159023","pull_request_url":"https://api.github.com/repos/wiredtiger/wiredtiger/pulls/1996","_links":{"self":{"href":"https://api.github.com/repos/wiredtiger/wiredtiger/pulls/comments/31159023"},"html":{"href":"https://github.com/wiredtiger/wiredtiger/pull/1996#discussion_r31159023"},"pull_request":{"href":"https://api.github.com/repos/wiredtiger/wiredtiger/pulls/1996"}}},"pull_request":{"url":"https://api.github.com/repos/wiredtiger/wiredtiger/pulls/1996","id":36260127,"html_url":"https://github.com/wiredtiger/wiredtiger/pull/1996","diff_url":"https://github.com/wiredtiger/wiredtiger/pull/1996.diff","patch_url":"https://github.com/wiredtiger/wiredtiger/pull/1996.patch","issue_url":"https://api.github.com/repos/wiredtiger/wiredtiger/issues/1996","number":1996,"state":"open","locked":false,"title":"Calculate a merge generation for bulk loaded LSM chunks.","user":{"login":"agorrod","id":1930121,"avatar_url":"https://avatars.githubusercontent.com/u/1930121?v=3","gravatar_id":"","url":"https://api.github.com/users/agorrod","html_url":"https://github.com/agorrod","followers_url":"https://api.github.com/users/agorrod/followers","following_url":"https://api.github.com/users/agorrod/following{/other_user}","gists_url":"https://api.github.com/users/agorrod/gists{/gist_id}","starred_url":"https://api.github.com/users/agorrod/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/agorrod/subscriptions","organizations_url":"https://api.github.com/users/agorrod/orgs","repos_url":"https://api.github.com/users/agorrod/repos","events_url":"https://api.github.com/users/agorrod/events{/privacy}","received_events_url":"https://api.github.com/users/agorrod/received_events","type":"User","site_admin":false},"body":"Otherwise LSM tends to choose poor merges after a bulk load,\r\nwhich leads to degraded performance.\r\n\r\nRefs WT-1947","created_at":"2015-05-27T00:53:25Z","updated_at":"2015-05-27T17:33:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d8750795ce01edab407a4f8831aa2cc17ecd44e5","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/wiredtiger/wiredtiger/pulls/1996/commits","review_comments_url":"https://api.github.com/repos/wiredtiger/wiredtiger/pulls/1996/comments","review_comment_url":"https://api.github.com/repos/wiredtiger/wiredtiger/pulls/comments{/number}","comments_url":"https://api.github.com/repos/wiredtiger/wiredtiger/issues/1996/comments","statuses_url":"https://api.github.com/repos/wiredtiger/wiredtiger/statuses/0b42eab5213d539b9d696a57a93778bde4323b32","head":{"label":"wiredtiger:lsm-bulk-load-generation","ref":"lsm-bulk-load-generation","sha":"0b42eab5213d539b9d696a57a93778bde4323b32","user":{"login":"wiredtiger","id":1251095,"avatar_url":"https://avatars.githubusercontent.com/u/1251095?v=3","gravatar_id":"","url":"https://api.github.com/users/wiredtiger","html_url":"https://github.com/wiredtiger","followers_url":"https://api.github.com/users/wiredtiger/followers","following_url":"https://api.github.com/users/wiredtiger/following{/other_user}","gists_url":"https://api.github.com/users/wiredtiger/gists{/gist_id}","starred_url":"https://api.github.com/users/wiredtiger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wiredtiger/subscriptions","organizations_url":"https://api.github.com/users/wiredtiger/orgs","repos_url":"https://api.github.com/users/wiredtiger/repos","events_url":"https://api.github.com/users/wiredtiger/events{/privacy}","received_events_url":"https://api.github.com/users/wiredtiger/received_events","type":"Organization","site_admin":false},"repo":{"id":2944302,"name":"wiredtiger","full_name":"wiredtiger/wiredtiger","owner":{"login":"wiredtiger","id":1251095,"avatar_url":"https://avatars.githubusercontent.com/u/1251095?v=3","gravatar_id":"","url":"https://api.github.com/users/wiredtiger","html_url":"https://github.com/wiredtiger","followers_url":"https://api.github.com/users/wiredtiger/followers","following_url":"https://api.github.com/users/wiredtiger/following{/other_user}","gists_url":"https://api.github.com/users/wiredtiger/gists{/gist_id}","starred_url":"https://api.github.com/users/wiredtiger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wiredtiger/subscriptions","organizations_url":"https://api.github.com/users/wiredtiger/orgs","repos_url":"https://api.github.com/users/wiredtiger/repos","events_url":"https://api.github.com/users/wiredtiger/events{/privacy}","received_events_url":"https://api.github.com/users/wiredtiger/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/wiredtiger/wiredtiger","description":"WiredTiger's source tree","fork":false,"url":"https://api.github.com/repos/wiredtiger/wiredtiger","forks_url":"https://api.github.com/repos/wiredtiger/wiredtiger/forks","keys_url":"https://api.github.com/repos/wiredtiger/wiredtiger/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wiredtiger/wiredtiger/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wiredtiger/wiredtiger/teams","hooks_url":"https://api.github.com/repos/wiredtiger/wiredtiger/hooks","issue_events_url":"https://api.github.com/repos/wiredtiger/wiredtiger/issues/events{/number}","events_url":"https://api.github.com/repos/wiredtiger/wiredtiger/events","assignees_url":"https://api.github.com/repos/wiredtiger/wiredtiger/assignees{/user}","branches_url":"https://api.github.com/repos/wiredtiger/wiredtiger/branches{/branch}","tags_url":"https://api.github.com/repos/wiredtiger/wiredtiger/tags","blobs_url":"https://api.github.com/repos/wiredtiger/wiredtiger/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wiredtiger/wiredtiger/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wiredtiger/wiredtiger/git/refs{/sha}","trees_url":"https://api.github.com/repos/wiredtiger/wiredtiger/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wiredtiger/wiredtiger/statuses/{sha}","languages_url":"https://api.github.com/repos/wiredtiger/wiredtiger/languages","stargazers_url":"https://api.github.com/repos/wiredtiger/wiredtiger/stargazers","contributors_url":"https://api.github.com/repos/wiredtiger/wiredtiger/contributors","subscribers_url":"https://api.github.com/repos/wiredtiger/wiredtiger/subscribers","subscription_url":"https://api.github.com/repos/wiredtiger/wiredtiger/subscription","commits_url":"https://api.github.com/repos/wiredtiger/wiredtiger/commits{/sha}","git_commits_url":"https://api.github.com/repos/wiredtiger/wiredtiger/git/commits{/sha}","comments_url":"https://api.github.com/repos/wiredtiger/wiredtiger/comments{/number}","issue_comment_url":"https://api.github.com/repos/wiredtiger/wiredtiger/issues/comments{/number}","contents_url":"https://api.github.com/repos/wiredtiger/wiredtiger/contents/{+path}","compare_url":"https://api.github.com/repos/wiredtiger/wiredtiger/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wiredtiger/wiredtiger/merges","archive_url":"https://api.github.com/repos/wiredtiger/wiredtiger/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wiredtiger/wiredtiger/downloads","issues_url":"https://api.github.com/repos/wiredtiger/wiredtiger/issues{/number}","pulls_url":"https://api.github.com/repos/wiredtiger/wiredtiger/pulls{/number}","milestones_url":"https://api.github.com/repos/wiredtiger/wiredtiger/milestones{/number}","notifications_url":"https://api.github.com/repos/wiredtiger/wiredtiger/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wiredtiger/wiredtiger/labels{/name}","releases_url":"https://api.github.com/repos/wiredtiger/wiredtiger/releases{/id}","created_at":"2011-12-09T00:43:19Z","updated_at":"2015-05-26T11:44:47Z","pushed_at":"2015-05-27T16:58:16Z","git_url":"git://github.com/wiredtiger/wiredtiger.git","ssh_url":"git@github.com:wiredtiger/wiredtiger.git","clone_url":"https://github.com/wiredtiger/wiredtiger.git","svn_url":"https://github.com/wiredtiger/wiredtiger","homepage":"http://source.wiredtiger.com/","size":110131,"stargazers_count":493,"watchers_count":493,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":82,"mirror_url":null,"open_issues_count":10,"forks":82,"open_issues":10,"watchers":493,"default_branch":"master"}},"base":{"label":"wiredtiger:develop","ref":"develop","sha":"b119a556cbb3c4c48c35621d239152079cabcfa6","user":{"login":"wiredtiger","id":1251095,"avatar_url":"https://avatars.githubusercontent.com/u/1251095?v=3","gravatar_id":"","url":"https://api.github.com/users/wiredtiger","html_url":"https://github.com/wiredtiger","followers_url":"https://api.github.com/users/wiredtiger/followers","following_url":"https://api.github.com/users/wiredtiger/following{/other_user}","gists_url":"https://api.github.com/users/wiredtiger/gists{/gist_id}","starred_url":"https://api.github.com/users/wiredtiger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wiredtiger/subscriptions","organizations_url":"https://api.github.com/users/wiredtiger/orgs","repos_url":"https://api.github.com/users/wiredtiger/repos","events_url":"https://api.github.com/users/wiredtiger/events{/privacy}","received_events_url":"https://api.github.com/users/wiredtiger/received_events","type":"Organization","site_admin":false},"repo":{"id":2944302,"name":"wiredtiger","full_name":"wiredtiger/wiredtiger","owner":{"login":"wiredtiger","id":1251095,"avatar_url":"https://avatars.githubusercontent.com/u/1251095?v=3","gravatar_id":"","url":"https://api.github.com/users/wiredtiger","html_url":"https://github.com/wiredtiger","followers_url":"https://api.github.com/users/wiredtiger/followers","following_url":"https://api.github.com/users/wiredtiger/following{/other_user}","gists_url":"https://api.github.com/users/wiredtiger/gists{/gist_id}","starred_url":"https://api.github.com/users/wiredtiger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wiredtiger/subscriptions","organizations_url":"https://api.github.com/users/wiredtiger/orgs","repos_url":"https://api.github.com/users/wiredtiger/repos","events_url":"https://api.github.com/users/wiredtiger/events{/privacy}","received_events_url":"https://api.github.com/users/wiredtiger/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/wiredtiger/wiredtiger","description":"WiredTiger's source tree","fork":false,"url":"https://api.github.com/repos/wiredtiger/wiredtiger","forks_url":"https://api.github.com/repos/wiredtiger/wiredtiger/forks","keys_url":"https://api.github.com/repos/wiredtiger/wiredtiger/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wiredtiger/wiredtiger/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wiredtiger/wiredtiger/teams","hooks_url":"https://api.github.com/repos/wiredtiger/wiredtiger/hooks","issue_events_url":"https://api.github.com/repos/wiredtiger/wiredtiger/issues/events{/number}","events_url":"https://api.github.com/repos/wiredtiger/wiredtiger/events","assignees_url":"https://api.github.com/repos/wiredtiger/wiredtiger/assignees{/user}","branches_url":"https://api.github.com/repos/wiredtiger/wiredtiger/branches{/branch}","tags_url":"https://api.github.com/repos/wiredtiger/wiredtiger/tags","blobs_url":"https://api.github.com/repos/wiredtiger/wiredtiger/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wiredtiger/wiredtiger/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wiredtiger/wiredtiger/git/refs{/sha}","trees_url":"https://api.github.com/repos/wiredtiger/wiredtiger/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wiredtiger/wiredtiger/statuses/{sha}","languages_url":"https://api.github.com/repos/wiredtiger/wiredtiger/languages","stargazers_url":"https://api.github.com/repos/wiredtiger/wiredtiger/stargazers","contributors_url":"https://api.github.com/repos/wiredtiger/wiredtiger/contributors","subscribers_url":"https://api.github.com/repos/wiredtiger/wiredtiger/subscribers","subscription_url":"https://api.github.com/repos/wiredtiger/wiredtiger/subscription","commits_url":"https://api.github.com/repos/wiredtiger/wiredtiger/commits{/sha}","git_commits_url":"https://api.github.com/repos/wiredtiger/wiredtiger/git/commits{/sha}","comments_url":"https://api.github.com/repos/wiredtiger/wiredtiger/comments{/number}","issue_comment_url":"https://api.github.com/repos/wiredtiger/wiredtiger/issues/comments{/number}","contents_url":"https://api.github.com/repos/wiredtiger/wiredtiger/contents/{+path}","compare_url":"https://api.github.com/repos/wiredtiger/wiredtiger/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wiredtiger/wiredtiger/merges","archive_url":"https://api.github.com/repos/wiredtiger/wiredtiger/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wiredtiger/wiredtiger/downloads","issues_url":"https://api.github.com/repos/wiredtiger/wiredtiger/issues{/number}","pulls_url":"https://api.github.com/repos/wiredtiger/wiredtiger/pulls{/number}","milestones_url":"https://api.github.com/repos/wiredtiger/wiredtiger/milestones{/number}","notifications_url":"https://api.github.com/repos/wiredtiger/wiredtiger/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wiredtiger/wiredtiger/labels{/name}","releases_url":"https://api.github.com/repos/wiredtiger/wiredtiger/releases{/id}","created_at":"2011-12-09T00:43:19Z","updated_at":"2015-05-26T11:44:47Z","pushed_at":"2015-05-27T16:58:16Z","git_url":"git://github.com/wiredtiger/wiredtiger.git","ssh_url":"git@github.com:wiredtiger/wiredtiger.git","clone_url":"https://github.com/wiredtiger/wiredtiger.git","svn_url":"https://github.com/wiredtiger/wiredtiger","homepage":"http://source.wiredtiger.com/","size":110131,"stargazers_count":493,"watchers_count":493,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":82,"mirror_url":null,"open_issues_count":10,"forks":82,"open_issues":10,"watchers":493,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/wiredtiger/wiredtiger/pulls/1996"},"html":{"href":"https://github.com/wiredtiger/wiredtiger/pull/1996"},"issue":{"href":"https://api.github.com/repos/wiredtiger/wiredtiger/issues/1996"},"comments":{"href":"https://api.github.com/repos/wiredtiger/wiredtiger/issues/1996/comments"},"review_comments":{"href":"https://api.github.com/repos/wiredtiger/wiredtiger/pulls/1996/comments"},"review_comment":{"href":"https://api.github.com/repos/wiredtiger/wiredtiger/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/wiredtiger/wiredtiger/pulls/1996/commits"},"statuses":{"href":"https://api.github.com/repos/wiredtiger/wiredtiger/statuses/0b42eab5213d539b9d696a57a93778bde4323b32"}}}}