{"action":"created","comment":{"url":"https://api.github.com/repos/elastic/elasticsearch/pulls/comments/32235876","id":32235876,"diff_hunk":"@@ -174,4 +147,42 @@ public MergeScheduler clone() {\n         // the clone will just be the identity.\n         return this;\n     }\n+\n+    @Override\n+    protected boolean maybeStall(IndexWriter writer) {\n+        // Don't stall here, because we do our own index throttling (in InternalEngine.IndexThrottle) when merges can't keep up\n+        return true;\n+    }\n+\n+    @Override\n+    protected MergeThread getMergeThread(IndexWriter writer, MergePolicy.OneMerge merge) throws IOException {\n+        MergeThread thread = super.getMergeThread(writer, merge);\n+        thread.setName(EsExecutors.threadName(indexSettings, \"[\" + shardId.index().name() + \"][\" + shardId.id() + \"]: \" + thread.getName()));\n+        return thread;\n+    }\n+\n+    MergeStats stats() {\n+        MergeStats mergeStats = new MergeStats();\n+        // TODO: why would there be more than one CMS for a single shard...?\n+        mergeStats.add(totalMerges.count(), totalMerges.sum(), totalMergesNumDocs.count(), totalMergesSizeInBytes.count(),\n+                currentMerges.count(), currentMergesNumDocs.count(), currentMergesSizeInBytes.count(),\n+                totalMergeStoppedTime.count(),\n+                totalMergeThrottledTime.count(),\n+                config.isAutoThrottle() ? getIORateLimitMBPerSec() : Double.POSITIVE_INFINITY);\n+        return mergeStats;\n+    }\n+\n+    void refreshConfig() {\n+        if (this.getMaxMergeCount() != config.getMaxMergeCount() + 1 || this.getMaxThreadCount() != config.getMaxThreadCount()) {\n+            // NOTE: we pass maxMergeCount+1 here so that CMS will allow one too many merges to kick off which then allows\n+            // InternalEngine.IndexThrottle to detect too-many-merges and throttle:\n+            this.setMaxMergesAndThreads(config.getMaxMergeCount() + 1, config.getMaxThreadCount());\n+        }\n+        if (config.isAutoThrottle() && getIORateLimitMBPerSec() == Double.POSITIVE_INFINITY) {","path":"core/src/main/java/org/elasticsearch/index/engine/ElasticsearchConcurrentMergeScheduler.java","position":164,"original_position":164,"commit_id":"307a9bdf368b0cff3a18cad2eecaf970a9a01dd5","original_commit_id":"307a9bdf368b0cff3a18cad2eecaf970a9a01dd5","user":{"login":"mikemccand","id":796508,"avatar_url":"https://avatars.githubusercontent.com/u/796508?v=3","gravatar_id":"","url":"https://api.github.com/users/mikemccand","html_url":"https://github.com/mikemccand","followers_url":"https://api.github.com/users/mikemccand/followers","following_url":"https://api.github.com/users/mikemccand/following{/other_user}","gists_url":"https://api.github.com/users/mikemccand/gists{/gist_id}","starred_url":"https://api.github.com/users/mikemccand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikemccand/subscriptions","organizations_url":"https://api.github.com/users/mikemccand/orgs","repos_url":"https://api.github.com/users/mikemccand/repos","events_url":"https://api.github.com/users/mikemccand/events{/privacy}","received_events_url":"https://api.github.com/users/mikemccand/received_events","type":"User","site_admin":false},"body":"Hmm why do we `&& getIORateLimitMBPerSec() == Double.POSITIVE_INFINITY` here?","created_at":"2015-06-11T15:51:45Z","updated_at":"2015-06-11T15:51:45Z","html_url":"https://github.com/elastic/elasticsearch/pull/11602#discussion_r32235876","pull_request_url":"https://api.github.com/repos/elastic/elasticsearch/pulls/11602","_links":{"self":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/comments/32235876"},"html":{"href":"https://github.com/elastic/elasticsearch/pull/11602#discussion_r32235876"},"pull_request":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/11602"}}},"pull_request":{"url":"https://api.github.com/repos/elastic/elasticsearch/pulls/11602","id":37472495,"html_url":"https://github.com/elastic/elasticsearch/pull/11602","diff_url":"https://github.com/elastic/elasticsearch/pull/11602.diff","patch_url":"https://github.com/elastic/elasticsearch/pull/11602.patch","issue_url":"https://api.github.com/repos/elastic/elasticsearch/issues/11602","number":11602,"state":"open","locked":false,"title":"Cleanup MergeScheduler infrastrucutre","user":{"login":"s1monw","id":973334,"avatar_url":"https://avatars.githubusercontent.com/u/973334?v=3","gravatar_id":"","url":"https://api.github.com/users/s1monw","html_url":"https://github.com/s1monw","followers_url":"https://api.github.com/users/s1monw/followers","following_url":"https://api.github.com/users/s1monw/following{/other_user}","gists_url":"https://api.github.com/users/s1monw/gists{/gist_id}","starred_url":"https://api.github.com/users/s1monw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/s1monw/subscriptions","organizations_url":"https://api.github.com/users/s1monw/orgs","repos_url":"https://api.github.com/users/s1monw/repos","events_url":"https://api.github.com/users/s1monw/events{/privacy}","received_events_url":"https://api.github.com/users/s1monw/received_events","type":"User","site_admin":false},"body":"This commit cleans up all the MergeScheduler infrastructure\r\nand simplifies / removes all unneeded abstractions. The MergeScheduler\r\nitself is now private to the Engine and all abstractions like Providers\r\nthat had support for multiple merge schedulers etc. are removed.\r\n\r\n@mikemccand do you wanna review this please","created_at":"2015-06-11T14:57:59Z","updated_at":"2015-06-11T15:51:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e0978447ef5eee3c7ff916257716455ba1400731","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/elastic/elasticsearch/pulls/11602/commits","review_comments_url":"https://api.github.com/repos/elastic/elasticsearch/pulls/11602/comments","review_comment_url":"https://api.github.com/repos/elastic/elasticsearch/pulls/comments{/number}","comments_url":"https://api.github.com/repos/elastic/elasticsearch/issues/11602/comments","statuses_url":"https://api.github.com/repos/elastic/elasticsearch/statuses/307a9bdf368b0cff3a18cad2eecaf970a9a01dd5","head":{"label":"s1monw:cleanup_merge_scheduler","ref":"cleanup_merge_scheduler","sha":"307a9bdf368b0cff3a18cad2eecaf970a9a01dd5","user":{"login":"s1monw","id":973334,"avatar_url":"https://avatars.githubusercontent.com/u/973334?v=3","gravatar_id":"","url":"https://api.github.com/users/s1monw","html_url":"https://github.com/s1monw","followers_url":"https://api.github.com/users/s1monw/followers","following_url":"https://api.github.com/users/s1monw/following{/other_user}","gists_url":"https://api.github.com/users/s1monw/gists{/gist_id}","starred_url":"https://api.github.com/users/s1monw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/s1monw/subscriptions","organizations_url":"https://api.github.com/users/s1monw/orgs","repos_url":"https://api.github.com/users/s1monw/repos","events_url":"https://api.github.com/users/s1monw/events{/privacy}","received_events_url":"https://api.github.com/users/s1monw/received_events","type":"User","site_admin":false},"repo":{"id":4663744,"name":"elasticsearch","full_name":"s1monw/elasticsearch","owner":{"login":"s1monw","id":973334,"avatar_url":"https://avatars.githubusercontent.com/u/973334?v=3","gravatar_id":"","url":"https://api.github.com/users/s1monw","html_url":"https://github.com/s1monw","followers_url":"https://api.github.com/users/s1monw/followers","following_url":"https://api.github.com/users/s1monw/following{/other_user}","gists_url":"https://api.github.com/users/s1monw/gists{/gist_id}","starred_url":"https://api.github.com/users/s1monw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/s1monw/subscriptions","organizations_url":"https://api.github.com/users/s1monw/orgs","repos_url":"https://api.github.com/users/s1monw/repos","events_url":"https://api.github.com/users/s1monw/events{/privacy}","received_events_url":"https://api.github.com/users/s1monw/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/s1monw/elasticsearch","description":"Open Source, Distributed, RESTful Search Engine","fork":true,"url":"https://api.github.com/repos/s1monw/elasticsearch","forks_url":"https://api.github.com/repos/s1monw/elasticsearch/forks","keys_url":"https://api.github.com/repos/s1monw/elasticsearch/keys{/key_id}","collaborators_url":"https://api.github.com/repos/s1monw/elasticsearch/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/s1monw/elasticsearch/teams","hooks_url":"https://api.github.com/repos/s1monw/elasticsearch/hooks","issue_events_url":"https://api.github.com/repos/s1monw/elasticsearch/issues/events{/number}","events_url":"https://api.github.com/repos/s1monw/elasticsearch/events","assignees_url":"https://api.github.com/repos/s1monw/elasticsearch/assignees{/user}","branches_url":"https://api.github.com/repos/s1monw/elasticsearch/branches{/branch}","tags_url":"https://api.github.com/repos/s1monw/elasticsearch/tags","blobs_url":"https://api.github.com/repos/s1monw/elasticsearch/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/s1monw/elasticsearch/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/s1monw/elasticsearch/git/refs{/sha}","trees_url":"https://api.github.com/repos/s1monw/elasticsearch/git/trees{/sha}","statuses_url":"https://api.github.com/repos/s1monw/elasticsearch/statuses/{sha}","languages_url":"https://api.github.com/repos/s1monw/elasticsearch/languages","stargazers_url":"https://api.github.com/repos/s1monw/elasticsearch/stargazers","contributors_url":"https://api.github.com/repos/s1monw/elasticsearch/contributors","subscribers_url":"https://api.github.com/repos/s1monw/elasticsearch/subscribers","subscription_url":"https://api.github.com/repos/s1monw/elasticsearch/subscription","commits_url":"https://api.github.com/repos/s1monw/elasticsearch/commits{/sha}","git_commits_url":"https://api.github.com/repos/s1monw/elasticsearch/git/commits{/sha}","comments_url":"https://api.github.com/repos/s1monw/elasticsearch/comments{/number}","issue_comment_url":"https://api.github.com/repos/s1monw/elasticsearch/issues/comments{/number}","contents_url":"https://api.github.com/repos/s1monw/elasticsearch/contents/{+path}","compare_url":"https://api.github.com/repos/s1monw/elasticsearch/compare/{base}...{head}","merges_url":"https://api.github.com/repos/s1monw/elasticsearch/merges","archive_url":"https://api.github.com/repos/s1monw/elasticsearch/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/s1monw/elasticsearch/downloads","issues_url":"https://api.github.com/repos/s1monw/elasticsearch/issues{/number}","pulls_url":"https://api.github.com/repos/s1monw/elasticsearch/pulls{/number}","milestones_url":"https://api.github.com/repos/s1monw/elasticsearch/milestones{/number}","notifications_url":"https://api.github.com/repos/s1monw/elasticsearch/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/s1monw/elasticsearch/labels{/name}","releases_url":"https://api.github.com/repos/s1monw/elasticsearch/releases{/id}","created_at":"2012-06-14T13:44:13Z","updated_at":"2015-05-07T08:25:29Z","pushed_at":"2015-06-11T15:46:48Z","git_url":"git://github.com/s1monw/elasticsearch.git","ssh_url":"git@github.com:s1monw/elasticsearch.git","clone_url":"https://github.com/s1monw/elasticsearch.git","svn_url":"https://github.com/s1monw/elasticsearch","homepage":"http://elasticsearch.org","size":140374,"stargazers_count":1,"watchers_count":1,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"elastic:master","ref":"master","sha":"1528b86b293988da5c90460d71a19fdb95986d6f","user":{"login":"elastic","id":6764390,"avatar_url":"https://avatars.githubusercontent.com/u/6764390?v=3","gravatar_id":"","url":"https://api.github.com/users/elastic","html_url":"https://github.com/elastic","followers_url":"https://api.github.com/users/elastic/followers","following_url":"https://api.github.com/users/elastic/following{/other_user}","gists_url":"https://api.github.com/users/elastic/gists{/gist_id}","starred_url":"https://api.github.com/users/elastic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elastic/subscriptions","organizations_url":"https://api.github.com/users/elastic/orgs","repos_url":"https://api.github.com/users/elastic/repos","events_url":"https://api.github.com/users/elastic/events{/privacy}","received_events_url":"https://api.github.com/users/elastic/received_events","type":"Organization","site_admin":false},"repo":{"id":507775,"name":"elasticsearch","full_name":"elastic/elasticsearch","owner":{"login":"elastic","id":6764390,"avatar_url":"https://avatars.githubusercontent.com/u/6764390?v=3","gravatar_id":"","url":"https://api.github.com/users/elastic","html_url":"https://github.com/elastic","followers_url":"https://api.github.com/users/elastic/followers","following_url":"https://api.github.com/users/elastic/following{/other_user}","gists_url":"https://api.github.com/users/elastic/gists{/gist_id}","starred_url":"https://api.github.com/users/elastic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elastic/subscriptions","organizations_url":"https://api.github.com/users/elastic/orgs","repos_url":"https://api.github.com/users/elastic/repos","events_url":"https://api.github.com/users/elastic/events{/privacy}","received_events_url":"https://api.github.com/users/elastic/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/elastic/elasticsearch","description":"Open Source, Distributed, RESTful Search Engine","fork":false,"url":"https://api.github.com/repos/elastic/elasticsearch","forks_url":"https://api.github.com/repos/elastic/elasticsearch/forks","keys_url":"https://api.github.com/repos/elastic/elasticsearch/keys{/key_id}","collaborators_url":"https://api.github.com/repos/elastic/elasticsearch/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/elastic/elasticsearch/teams","hooks_url":"https://api.github.com/repos/elastic/elasticsearch/hooks","issue_events_url":"https://api.github.com/repos/elastic/elasticsearch/issues/events{/number}","events_url":"https://api.github.com/repos/elastic/elasticsearch/events","assignees_url":"https://api.github.com/repos/elastic/elasticsearch/assignees{/user}","branches_url":"https://api.github.com/repos/elastic/elasticsearch/branches{/branch}","tags_url":"https://api.github.com/repos/elastic/elasticsearch/tags","blobs_url":"https://api.github.com/repos/elastic/elasticsearch/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/elastic/elasticsearch/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/elastic/elasticsearch/git/refs{/sha}","trees_url":"https://api.github.com/repos/elastic/elasticsearch/git/trees{/sha}","statuses_url":"https://api.github.com/repos/elastic/elasticsearch/statuses/{sha}","languages_url":"https://api.github.com/repos/elastic/elasticsearch/languages","stargazers_url":"https://api.github.com/repos/elastic/elasticsearch/stargazers","contributors_url":"https://api.github.com/repos/elastic/elasticsearch/contributors","subscribers_url":"https://api.github.com/repos/elastic/elasticsearch/subscribers","subscription_url":"https://api.github.com/repos/elastic/elasticsearch/subscription","commits_url":"https://api.github.com/repos/elastic/elasticsearch/commits{/sha}","git_commits_url":"https://api.github.com/repos/elastic/elasticsearch/git/commits{/sha}","comments_url":"https://api.github.com/repos/elastic/elasticsearch/comments{/number}","issue_comment_url":"https://api.github.com/repos/elastic/elasticsearch/issues/comments{/number}","contents_url":"https://api.github.com/repos/elastic/elasticsearch/contents/{+path}","compare_url":"https://api.github.com/repos/elastic/elasticsearch/compare/{base}...{head}","merges_url":"https://api.github.com/repos/elastic/elasticsearch/merges","archive_url":"https://api.github.com/repos/elastic/elasticsearch/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/elastic/elasticsearch/downloads","issues_url":"https://api.github.com/repos/elastic/elasticsearch/issues{/number}","pulls_url":"https://api.github.com/repos/elastic/elasticsearch/pulls{/number}","milestones_url":"https://api.github.com/repos/elastic/elasticsearch/milestones{/number}","notifications_url":"https://api.github.com/repos/elastic/elasticsearch/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/elastic/elasticsearch/labels{/name}","releases_url":"https://api.github.com/repos/elastic/elasticsearch/releases{/id}","created_at":"2010-02-08T13:20:56Z","updated_at":"2015-06-11T15:05:36Z","pushed_at":"2015-06-11T15:34:28Z","git_url":"git://github.com/elastic/elasticsearch.git","ssh_url":"git@github.com:elastic/elasticsearch.git","clone_url":"https://github.com/elastic/elasticsearch.git","svn_url":"https://github.com/elastic/elasticsearch","homepage":"https://www.elastic.co/products/elasticsearch","size":1889614,"stargazers_count":11567,"watchers_count":11567,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":3660,"mirror_url":null,"open_issues_count":1110,"forks":3660,"open_issues":1110,"watchers":11567,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/11602"},"html":{"href":"https://github.com/elastic/elasticsearch/pull/11602"},"issue":{"href":"https://api.github.com/repos/elastic/elasticsearch/issues/11602"},"comments":{"href":"https://api.github.com/repos/elastic/elasticsearch/issues/11602/comments"},"review_comments":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/11602/comments"},"review_comment":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/11602/commits"},"statuses":{"href":"https://api.github.com/repos/elastic/elasticsearch/statuses/307a9bdf368b0cff3a18cad2eecaf970a9a01dd5"}}}}