|
5 | 5 | cluster.allocation_explain: {}
|
6 | 6 |
|
7 | 7 | ---
|
8 |
| -"cluster shard allocation explanation test": |
| 8 | +"cluster shard allocation explanation test with empty request": |
| 9 | + - do: |
| 10 | + indices.create: |
| 11 | + index: test |
| 12 | + body: { "settings": { "index.number_of_shards": 1, "index.number_of_replicas": 9 } } |
| 13 | + |
| 14 | + - do: |
| 15 | + cluster.allocation_explain: |
| 16 | + include_disk_info: true |
| 17 | + |
| 18 | + - match: { current_state: "unassigned" } |
| 19 | + - match: { unassigned_info.reason: "INDEX_CREATED" } |
| 20 | + - is_true: unassigned_info.at |
| 21 | + - match: { index: "test" } |
| 22 | + - match: { shard: 0 } |
| 23 | + - match: { primary: false } |
| 24 | + - is_true: cluster_info |
| 25 | + - is_true: can_allocate |
| 26 | + |
| 27 | +--- |
| 28 | +# This test has a valid integer input, but it's above the shard limit, so the index cannot be located |
| 29 | +"cluster shard allocation explanation test with max integer shard value": |
9 | 30 | - do:
|
10 | 31 | indices.create:
|
11 | 32 | index: test
|
12 | 33 |
|
13 | 34 | - match: { acknowledged: true }
|
14 | 35 |
|
15 | 36 | - do:
|
| 37 | + catch: /shard_not_found_exception/ |
16 | 38 | cluster.allocation_explain:
|
17 |
| - body: { "index": "test", "shard": 0, "primary": true } |
| 39 | + body: { "index": "test", "shard": 2147483647, "primary": true } |
| 40 | + |
| 41 | +--- |
| 42 | +"cluster shard allocation explanation test with long shard value": |
| 43 | + - do: |
| 44 | + indices.create: |
| 45 | + index: test |
| 46 | + |
| 47 | + - match: { acknowledged: true } |
| 48 | + |
| 49 | + - do: |
| 50 | + catch: /x_content_parse_exception/ |
| 51 | + cluster.allocation_explain: |
| 52 | + body: { "index": "test", "shard": 214748364777, "primary": true } |
| 53 | + |
| 54 | +--- |
| 55 | +"cluster shard allocation explanation test with float shard value": |
| 56 | + - do: |
| 57 | + indices.create: |
| 58 | + index: test |
| 59 | + body: { "settings": { "index.number_of_shards": 2, "index.number_of_replicas": 0 } } |
| 60 | + |
| 61 | + - match: { acknowledged: true } |
| 62 | + |
| 63 | + - do: |
| 64 | + cluster.allocation_explain: |
| 65 | + body: { "index": "test", "shard": 1.0, "primary": true } |
18 | 66 |
|
19 | 67 | - match: { current_state: "started" }
|
20 | 68 | - is_true: current_node.id
|
21 | 69 | - match: { index: "test" }
|
22 |
| - - match: { shard: 0 } |
| 70 | + - match: { shard: 1 } |
23 | 71 | - match: { primary: true }
|
24 | 72 | - is_true: can_remain_on_current_node
|
25 | 73 | - is_true: can_rebalance_cluster
|
26 | 74 | - is_true: can_rebalance_to_other_node
|
27 | 75 | - is_true: rebalance_explanation
|
28 | 76 |
|
29 | 77 | ---
|
30 |
| -"cluster shard allocation explanation test with empty request": |
| 78 | +"cluster shard allocation explanation test with double shard value": |
31 | 79 | - do:
|
32 | 80 | indices.create:
|
33 | 81 | index: test
|
34 |
| - body: { "settings": { "index.number_of_shards": 1, "index.number_of_replicas": 9 } } |
| 82 | + body: { "settings": { "index.number_of_shards": 2, "index.number_of_replicas": 0 } } |
| 83 | + |
| 84 | + - match: { acknowledged: true } |
35 | 85 |
|
36 | 86 | - do:
|
37 | 87 | cluster.allocation_explain:
|
38 |
| - include_disk_info: true |
| 88 | + body: { "index": "test", "shard": 1.1234567891234567, "primary": true } |
39 | 89 |
|
40 |
| - - match: { current_state: "unassigned" } |
41 |
| - - match: { unassigned_info.reason: "INDEX_CREATED" } |
42 |
| - - is_true: unassigned_info.at |
| 90 | + - match: { current_state: "started" } |
| 91 | + - is_true: current_node.id |
43 | 92 | - match: { index: "test" }
|
44 |
| - - match: { shard: 0 } |
45 |
| - - match: { primary: false } |
46 |
| - - is_true: cluster_info |
47 |
| - - is_true: can_allocate |
| 93 | + - match: { shard: 1 } |
| 94 | + - match: { primary: true } |
| 95 | + - is_true: can_remain_on_current_node |
| 96 | + - is_true: can_rebalance_cluster |
| 97 | + - is_true: can_rebalance_to_other_node |
| 98 | + - is_true: rebalance_explanation |
48 | 99 |
|
| 100 | +--- |
| 101 | +"cluster shard allocation explanation test with three valid body parameters": |
| 102 | + - do: |
| 103 | + indices.create: |
| 104 | + index: test |
| 105 | + |
| 106 | + - match: { acknowledged: true } |
| 107 | + |
| 108 | + - do: |
| 109 | + cluster.allocation_explain: |
| 110 | + body: { "index": "test", "shard": 0, "primary": true } |
| 111 | + |
| 112 | + - match: { current_state: "started" } |
| 113 | + - is_true: current_node.id |
| 114 | + - match: { index: "test" } |
| 115 | + - match: { shard: 0 } |
| 116 | + - match: { primary: true } |
| 117 | + - is_true: can_remain_on_current_node |
| 118 | + - is_true: can_rebalance_cluster |
| 119 | + - is_true: can_rebalance_to_other_node |
| 120 | + - is_true: rebalance_explanation |
49 | 121 |
|
50 | 122 | ---
|
51 | 123 | "Cluster shard allocation explanation test with a closed index":
|
|
0 commit comments