{"action":"created","comment":{"url":"https://api.github.com/repos/elastic/elasticsearch/pulls/comments/35797241","id":35797241,"diff_hunk":"@@ -162,6 +168,45 @@ public void rerouteWithAllocateLocalGateway_enableAllocationSettings() throws Ex\n         rerouteWithAllocateLocalGateway(commonSettings);\n     }\n \n+    /**\n+     * Test that we don't miss any reroutes when concurrent_recoveries\n+     * is set very low and there are a large number of unassigned shards.\n+     */\n+    @Test\n+    @LuceneTestCase.Slow\n+    public void testDelayWithALargeAmountOfShards() throws Exception {\n+        Settings commonSettings = settingsBuilder()\n+                .put(\"gateway.type\", \"local\")\n+                .put(ThrottlingAllocationDecider.CLUSTER_ROUTING_ALLOCATION_CONCURRENT_RECOVERIES, 1)\n+                .build();\n+        logger.info(\"--> starting 4 nodes\");\n+        String node_1 = internalCluster().startNode(commonSettings);\n+        internalCluster().startNode(commonSettings);\n+        internalCluster().startNode(commonSettings);\n+        internalCluster().startNode(commonSettings);\n+\n+        assertThat(cluster().size(), equalTo(4));\n+        ClusterHealthResponse healthResponse = client().admin().cluster().prepareHealth().setWaitForNodes(\"4\").execute().actionGet();\n+        assertThat(healthResponse.isTimedOut(), equalTo(false));\n+\n+        logger.info(\"--> create indices\");\n+        for (int i = 0; i < 25; i++) {\n+            client().admin().indices().prepareCreate(\"test\" + i)\n+                    .setSettings(settingsBuilder()\n+                            .put(\"index.number_of_shards\", 5).put(\"index.number_of_replicas\", 1)\n+                            .put(\"index.unassigned.node_left.delayed_timeout\", randomIntBetween(4, 15) + \"s\"))\n+                    .execute().actionGet();\n+        }\n+\n+        ensureGreen(TimeValue.timeValueMinutes(1));\n+\n+        logger.info(\"--> stopping node1\");\n+        internalCluster().stopRandomNode(InternalTestCluster.nameFilter(node_1));\n+\n+        // This might run slowly on older hardware\n+        ensureGreen(TimeValue.timeValueMinutes(2));","path":"src/test/java/org/elasticsearch/cluster/allocation/ClusterRerouteTests.java","position":74,"original_position":74,"commit_id":"7a613189c5df7ec55d23b2cd184677e19ad1219b","original_commit_id":"7a613189c5df7ec55d23b2cd184677e19ad1219b","user":{"login":"dakrone","id":19060,"avatar_url":"https://avatars.githubusercontent.com/u/19060?v=3","gravatar_id":"","url":"https://api.github.com/users/dakrone","html_url":"https://github.com/dakrone","followers_url":"https://api.github.com/users/dakrone/followers","following_url":"https://api.github.com/users/dakrone/following{/other_user}","gists_url":"https://api.github.com/users/dakrone/gists{/gist_id}","starred_url":"https://api.github.com/users/dakrone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dakrone/subscriptions","organizations_url":"https://api.github.com/users/dakrone/orgs","repos_url":"https://api.github.com/users/dakrone/repos","events_url":"https://api.github.com/users/dakrone/events{/privacy}","received_events_url":"https://api.github.com/users/dakrone/received_events","type":"User","site_admin":false},"body":"Some of our CI nodes are reeeeeaaaalllly slow, and since this creates 25 indices with 10 total shards each, I just wanted to make sure it doesn't time out. I do not expect it to take 2 minutes regardless (it's much faster for me). Another reason this test in annotated with `@Slow`","created_at":"2015-07-29T18:50:14Z","updated_at":"2015-07-29T18:50:14Z","html_url":"https://github.com/elastic/elasticsearch/pull/12532#discussion_r35797241","pull_request_url":"https://api.github.com/repos/elastic/elasticsearch/pulls/12532","_links":{"self":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/comments/35797241"},"html":{"href":"https://github.com/elastic/elasticsearch/pull/12532#discussion_r35797241"},"pull_request":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/12532"}}},"pull_request":{"url":"https://api.github.com/repos/elastic/elasticsearch/pulls/12532","id":41134793,"html_url":"https://github.com/elastic/elasticsearch/pull/12532","diff_url":"https://github.com/elastic/elasticsearch/pull/12532.diff","patch_url":"https://github.com/elastic/elasticsearch/pull/12532.patch","issue_url":"https://api.github.com/repos/elastic/elasticsearch/issues/12532","number":12532,"state":"open","locked":false,"title":"Avoid extra reroutes of delayed shards in RoutingService","user":{"login":"dakrone","id":19060,"avatar_url":"https://avatars.githubusercontent.com/u/19060?v=3","gravatar_id":"","url":"https://api.github.com/users/dakrone","html_url":"https://github.com/dakrone","followers_url":"https://api.github.com/users/dakrone/followers","following_url":"https://api.github.com/users/dakrone/following{/other_user}","gists_url":"https://api.github.com/users/dakrone/gists{/gist_id}","starred_url":"https://api.github.com/users/dakrone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dakrone/subscriptions","organizations_url":"https://api.github.com/users/dakrone/orgs","repos_url":"https://api.github.com/users/dakrone/repos","events_url":"https://api.github.com/users/dakrone/events{/privacy}","received_events_url":"https://api.github.com/users/dakrone/received_events","type":"User","site_admin":false},"body":"In order to avoid extra reroutes, `RoutingService` should avoid\r\nscheduling a reroute of any shards where the delay is negative. To make\r\nsure that we don't encounter a race condition between the\r\nGatewayAllocator thinking a shard is delayed and RoutingService thinking\r\nit is not, the GatewayAllocator will update the RoutingService with the\r\nlast time it checked in order to use a consistent \"view\" of the delay.\r\n\r\nResolves #12456\r\nRelates to #12515 and #12456\r\n\r\nThis is a PR against 1.7 and will be forward-ported","created_at":"2015-07-29T15:13:14Z","updated_at":"2015-07-29T18:50:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"02482fefa7dbd4ca6dec32eaa08f1ad18f0673e2","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/elastic/elasticsearch/pulls/12532/commits","review_comments_url":"https://api.github.com/repos/elastic/elasticsearch/pulls/12532/comments","review_comment_url":"https://api.github.com/repos/elastic/elasticsearch/pulls/comments{/number}","comments_url":"https://api.github.com/repos/elastic/elasticsearch/issues/12532/comments","statuses_url":"https://api.github.com/repos/elastic/elasticsearch/statuses/7a613189c5df7ec55d23b2cd184677e19ad1219b","head":{"label":"dakrone:avoid-extra-reroutes","ref":"avoid-extra-reroutes","sha":"7a613189c5df7ec55d23b2cd184677e19ad1219b","user":{"login":"dakrone","id":19060,"avatar_url":"https://avatars.githubusercontent.com/u/19060?v=3","gravatar_id":"","url":"https://api.github.com/users/dakrone","html_url":"https://github.com/dakrone","followers_url":"https://api.github.com/users/dakrone/followers","following_url":"https://api.github.com/users/dakrone/following{/other_user}","gists_url":"https://api.github.com/users/dakrone/gists{/gist_id}","starred_url":"https://api.github.com/users/dakrone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dakrone/subscriptions","organizations_url":"https://api.github.com/users/dakrone/orgs","repos_url":"https://api.github.com/users/dakrone/repos","events_url":"https://api.github.com/users/dakrone/events{/privacy}","received_events_url":"https://api.github.com/users/dakrone/received_events","type":"User","site_admin":false},"repo":{"id":3037278,"name":"elasticsearch","full_name":"dakrone/elasticsearch","owner":{"login":"dakrone","id":19060,"avatar_url":"https://avatars.githubusercontent.com/u/19060?v=3","gravatar_id":"","url":"https://api.github.com/users/dakrone","html_url":"https://github.com/dakrone","followers_url":"https://api.github.com/users/dakrone/followers","following_url":"https://api.github.com/users/dakrone/following{/other_user}","gists_url":"https://api.github.com/users/dakrone/gists{/gist_id}","starred_url":"https://api.github.com/users/dakrone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dakrone/subscriptions","organizations_url":"https://api.github.com/users/dakrone/orgs","repos_url":"https://api.github.com/users/dakrone/repos","events_url":"https://api.github.com/users/dakrone/events{/privacy}","received_events_url":"https://api.github.com/users/dakrone/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dakrone/elasticsearch","description":"Open Source, Distributed, RESTful Search Engine","fork":true,"url":"https://api.github.com/repos/dakrone/elasticsearch","forks_url":"https://api.github.com/repos/dakrone/elasticsearch/forks","keys_url":"https://api.github.com/repos/dakrone/elasticsearch/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dakrone/elasticsearch/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dakrone/elasticsearch/teams","hooks_url":"https://api.github.com/repos/dakrone/elasticsearch/hooks","issue_events_url":"https://api.github.com/repos/dakrone/elasticsearch/issues/events{/number}","events_url":"https://api.github.com/repos/dakrone/elasticsearch/events","assignees_url":"https://api.github.com/repos/dakrone/elasticsearch/assignees{/user}","branches_url":"https://api.github.com/repos/dakrone/elasticsearch/branches{/branch}","tags_url":"https://api.github.com/repos/dakrone/elasticsearch/tags","blobs_url":"https://api.github.com/repos/dakrone/elasticsearch/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dakrone/elasticsearch/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dakrone/elasticsearch/git/refs{/sha}","trees_url":"https://api.github.com/repos/dakrone/elasticsearch/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dakrone/elasticsearch/statuses/{sha}","languages_url":"https://api.github.com/repos/dakrone/elasticsearch/languages","stargazers_url":"https://api.github.com/repos/dakrone/elasticsearch/stargazers","contributors_url":"https://api.github.com/repos/dakrone/elasticsearch/contributors","subscribers_url":"https://api.github.com/repos/dakrone/elasticsearch/subscribers","subscription_url":"https://api.github.com/repos/dakrone/elasticsearch/subscription","commits_url":"https://api.github.com/repos/dakrone/elasticsearch/commits{/sha}","git_commits_url":"https://api.github.com/repos/dakrone/elasticsearch/git/commits{/sha}","comments_url":"https://api.github.com/repos/dakrone/elasticsearch/comments{/number}","issue_comment_url":"https://api.github.com/repos/dakrone/elasticsearch/issues/comments{/number}","contents_url":"https://api.github.com/repos/dakrone/elasticsearch/contents/{+path}","compare_url":"https://api.github.com/repos/dakrone/elasticsearch/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dakrone/elasticsearch/merges","archive_url":"https://api.github.com/repos/dakrone/elasticsearch/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dakrone/elasticsearch/downloads","issues_url":"https://api.github.com/repos/dakrone/elasticsearch/issues{/number}","pulls_url":"https://api.github.com/repos/dakrone/elasticsearch/pulls{/number}","milestones_url":"https://api.github.com/repos/dakrone/elasticsearch/milestones{/number}","notifications_url":"https://api.github.com/repos/dakrone/elasticsearch/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dakrone/elasticsearch/labels{/name}","releases_url":"https://api.github.com/repos/dakrone/elasticsearch/releases{/id}","created_at":"2011-12-22T23:14:00Z","updated_at":"2014-12-16T08:28:10Z","pushed_at":"2015-07-29T15:11:21Z","git_url":"git://github.com/dakrone/elasticsearch.git","ssh_url":"git@github.com:dakrone/elasticsearch.git","clone_url":"https://github.com/dakrone/elasticsearch.git","svn_url":"https://github.com/dakrone/elasticsearch","homepage":"http://elasticsearch.org","size":134805,"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:1.7","ref":"1.7","sha":"191188a9526c39f8461810ebfd10bfa3c44c37ef","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-07-29T15:02:19Z","pushed_at":"2015-07-29T18:42:32Z","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":1915767,"stargazers_count":12143,"watchers_count":12143,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":3884,"mirror_url":null,"open_issues_count":1164,"forks":3884,"open_issues":1164,"watchers":12143,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/12532"},"html":{"href":"https://github.com/elastic/elasticsearch/pull/12532"},"issue":{"href":"https://api.github.com/repos/elastic/elasticsearch/issues/12532"},"comments":{"href":"https://api.github.com/repos/elastic/elasticsearch/issues/12532/comments"},"review_comments":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/12532/comments"},"review_comment":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/elastic/elasticsearch/pulls/12532/commits"},"statuses":{"href":"https://api.github.com/repos/elastic/elasticsearch/statuses/7a613189c5df7ec55d23b2cd184677e19ad1219b"}}}}