{"push_id":1040496363,"size":2,"distinct_size":2,"ref":"refs/heads/master","head":"c63cb217457ae75392b226c44e58155dbf3600eb","before":"8a5c19b25f10c10bb93f8fce3957933630cdf0d6","commits":[{"sha":"80ab366de4d4a3a4ccf7750b593a50bcd5cdd08b","author":{"email":"cdedbaf433217656e9df940dd535438abed9f74c@writequit.org","name":"Lee Hinman"},"message":"Add API to explain why a shard is or isn't assigned\n\nThis adds a new `/_cluster/allocation/explain` API that explains why a\nshard can or cannot be allocated to nodes in the cluster. Additionally,\nit will show where the master *desires* to put the shard, according to\nthe `ShardsAllocator`.\n\nIt looks like this:\n\n```\nGET /_cluster/allocation/explain?pretty\n{\n  \"index\": \"only-foo\",\n  \"shard\": 0,\n  \"primary\": false\n}\n```\n\nThough, you can optionally send an empty body, which means \"explain the\nallocation for the first unassigned shard you find\".\n\nThe output when a shard is unassigned looks like this:\n\n```\n{\n  \"shard\" : {\n    \"index\" : \"only-foo\",\n    \"index_uuid\" : \"KnW0-zELRs6PK84l0r38ZA\",\n    \"id\" : 0,\n    \"primary\" : false\n  },\n  \"assigned\" : false,\n  \"unassigned_info\" : {\n    \"reason\" : \"INDEX_CREATED\",\n    \"at\" : \"2016-03-22T20:04:23.620Z\"\n  },\n  \"nodes\" : {\n    \"V-Spi0AyRZ6ZvKbaI3691w\" : {\n      \"node_name\" : \"Susan Storm\",\n      \"node_attributes\" : {\n        \"bar\" : \"baz\"\n      },\n      \"final_decision\" : \"NO\",\n      \"weight\" : 0.06666675,\n      \"decisions\" : [ {\n        \"decider\" : \"filter\",\n        \"decision\" : \"NO\",\n        \"explanation\" : \"node does not match index include filters [foo:\\\"bar\\\"]\"\n      } ]\n    },\n    \"Qc6VL8c5RWaw1qXZ0Rg57g\" : {\n      \"node_name\" : \"Slipstream\",\n      \"node_attributes\" : {\n        \"bar\" : \"baz\",\n        \"foo\" : \"bar\"\n      },\n      \"final_decision\" : \"NO\",\n      \"weight\" : -1.3833332,\n      \"decisions\" : [ {\n        \"decider\" : \"same_shard\",\n        \"decision\" : \"NO\",\n        \"explanation\" : \"the shard cannot be allocated on the same node id [Qc6VL8c5RWaw1qXZ0Rg57g] on which it already exists\"\n      } ]\n    },\n    \"PzdyMZGXQdGhqTJHF_hGgA\" : {\n      \"node_name\" : \"The Symbiote\",\n      \"node_attributes\" : { },\n      \"final_decision\" : \"NO\",\n      \"weight\" : 2.3166666,\n      \"decisions\" : [ {\n        \"decider\" : \"filter\",\n        \"decision\" : \"NO\",\n        \"explanation\" : \"node does not match index include filters [foo:\\\"bar\\\"]\"\n      } ]\n    }\n  }\n}\n```\n\nAnd when the shard *is* assigned, the output looks like:\n\n```\n{\n  \"shard\" : {\n    \"index\" : \"only-foo\",\n    \"index_uuid\" : \"KnW0-zELRs6PK84l0r38ZA\",\n    \"id\" : 0,\n    \"primary\" : true\n  },\n  \"assigned\" : true,\n  \"assigned_node_id\" : \"Qc6VL8c5RWaw1qXZ0Rg57g\",\n  \"nodes\" : {\n    \"V-Spi0AyRZ6ZvKbaI3691w\" : {\n      \"node_name\" : \"Susan Storm\",\n      \"node_attributes\" : {\n        \"bar\" : \"baz\"\n      },\n      \"final_decision\" : \"NO\",\n      \"weight\" : 1.4499999,\n      \"decisions\" : [ {\n        \"decider\" : \"filter\",\n        \"decision\" : \"NO\",\n        \"explanation\" : \"node does not match index include filters [foo:\\\"bar\\\"]\"\n      } ]\n    },\n    \"Qc6VL8c5RWaw1qXZ0Rg57g\" : {\n      \"node_name\" : \"Slipstream\",\n      \"node_attributes\" : {\n        \"bar\" : \"baz\",\n        \"foo\" : \"bar\"\n      },\n      \"final_decision\" : \"CURRENTLY_ASSIGNED\",\n      \"weight\" : 0.0,\n      \"decisions\" : [ {\n        \"decider\" : \"same_shard\",\n        \"decision\" : \"NO\",\n        \"explanation\" : \"the shard cannot be allocated on the same node id [Qc6VL8c5RWaw1qXZ0Rg57g] on which it already exists\"\n      } ]\n    },\n    \"PzdyMZGXQdGhqTJHF_hGgA\" : {\n      \"node_name\" : \"The Symbiote\",\n      \"node_attributes\" : { },\n      \"final_decision\" : \"NO\",\n      \"weight\" : 3.6999998,\n      \"decisions\" : [ {\n        \"decider\" : \"filter\",\n        \"decision\" : \"NO\",\n        \"explanation\" : \"node does not match index include filters [foo:\\\"bar\\\"]\"\n      } ]\n    }\n  }\n}\n```\n\nOnly \"NO\" decisions are returned by default, but all decisions can be\nshown by specifying the `?include_yes_decisions=true` parameter in the\nrequest.\n\nResolves #14593","distinct":true,"url":"https://api.github.com/repos/NSIT/elasticsearch/commits/80ab366de4d4a3a4ccf7750b593a50bcd5cdd08b"},{"sha":"c63cb217457ae75392b226c44e58155dbf3600eb","author":{"email":"cdedbaf433217656e9df940dd535438abed9f74c@writequit.org","name":"Lee Hinman"},"message":"Merge remote-tracking branch 'dakrone/allocation-explain'","distinct":true,"url":"https://api.github.com/repos/NSIT/elasticsearch/commits/c63cb217457ae75392b226c44e58155dbf3600eb"}]}