|
39 | 39 | body: { "index": "test", "shard": 2147483647, "primary": true } |
40 | 40 |
|
41 | 41 | --- |
42 | | -"cluster shard allocation explanation test with long shard value": |
| 42 | +"cluster shard allocation explanation test with an invalid, string shard parameter in the body": |
43 | 43 | - do: |
44 | 44 | indices.create: |
45 | 45 | index: test |
|
49 | 49 | - do: |
50 | 50 | catch: /x_content_parse_exception/ |
51 | 51 | cluster.allocation_explain: |
52 | | - body: { "index": "test", "shard": 214748364777, "primary": true } |
| 52 | + body: { "index": "test", "shard": "wrong", "primary": true } |
53 | 53 |
|
54 | 54 | --- |
55 | | -"cluster shard allocation explanation test with float shard value": |
| 55 | +"cluster shard allocation explanation test with a valid, string shard parameter in the body": |
56 | 56 | - do: |
57 | 57 | indices.create: |
58 | 58 | index: test |
59 | | - body: { "settings": { "index.number_of_shards": 2, "index.number_of_replicas": 0 } } |
60 | 59 |
|
61 | 60 | - match: { acknowledged: true } |
62 | 61 |
|
63 | 62 | - do: |
64 | 63 | cluster.allocation_explain: |
65 | | - body: { "index": "test", "shard": 1.0, "primary": true } |
| 64 | + body: { "index": "test", "shard": "0", "primary": true } |
66 | 65 |
|
67 | 66 | - match: { current_state: "started" } |
68 | 67 | - is_true: current_node.id |
69 | 68 | - match: { index: "test" } |
70 | | - - match: { shard: 1 } |
| 69 | + - match: { shard: 0 } |
71 | 70 | - match: { primary: true } |
72 | 71 | - is_true: can_remain_on_current_node |
73 | 72 | - is_true: can_rebalance_cluster |
74 | 73 | - is_true: can_rebalance_to_other_node |
75 | 74 | - is_true: rebalance_explanation |
76 | 75 |
|
| 76 | +--- |
| 77 | +"cluster shard allocation explanation test with long shard value": |
| 78 | + - requires: |
| 79 | + capabilities: |
| 80 | + - method: GET |
| 81 | + path: /_cluster/allocation/explain |
| 82 | + capabilities: [shard_parameter_non_integer_validation] |
| 83 | + test_runner_features: [capabilities] |
| 84 | + reason: Additional validation for the shard parameter was added in 9.2.0 |
| 85 | + |
| 86 | + - do: |
| 87 | + indices.create: |
| 88 | + index: test |
| 89 | + |
| 90 | + - match: { acknowledged: true } |
| 91 | + |
| 92 | + - do: |
| 93 | + catch: /x_content_parse_exception/ |
| 94 | + cluster.allocation_explain: |
| 95 | + body: { "index": "test", "shard": 214748364777, "primary": true } |
| 96 | + |
| 97 | +--- |
| 98 | +"cluster shard allocation explanation test with float shard value": |
| 99 | + - requires: |
| 100 | + capabilities: |
| 101 | + - method: GET |
| 102 | + path: /_cluster/allocation/explain |
| 103 | + capabilities: [ shard_parameter_non_integer_validation ] |
| 104 | + test_runner_features: [ capabilities ] |
| 105 | + reason: Additional validation for the shard parameter was added in 9.2.0 |
| 106 | + |
| 107 | + - do: |
| 108 | + indices.create: |
| 109 | + index: test |
| 110 | + body: { "settings": { "index.number_of_shards": 2, "index.number_of_replicas": 0 } } |
| 111 | + |
| 112 | + - match: { acknowledged: true } |
| 113 | + |
| 114 | + - do: |
| 115 | + catch: /illegal_argument_exception/ |
| 116 | + cluster.allocation_explain: |
| 117 | + body: { "index": "test", "shard": 1.0, "primary": true } |
| 118 | + |
| 119 | +--- |
| 120 | +"cluster shard allocation explanation test with stringified float shard value": |
| 121 | + - requires: |
| 122 | + capabilities: |
| 123 | + - method: GET |
| 124 | + path: /_cluster/allocation/explain |
| 125 | + capabilities: [ shard_parameter_non_integer_validation ] |
| 126 | + test_runner_features: [ capabilities ] |
| 127 | + reason: Additional validation for the shard parameter was added in 9.2.0 |
| 128 | + |
| 129 | + |
| 130 | + - do: |
| 131 | + indices.create: |
| 132 | + index: test |
| 133 | + body: { "settings": { "index.number_of_shards": 2, "index.number_of_replicas": 0 } } |
| 134 | + |
| 135 | + - match: { acknowledged: true } |
| 136 | + |
| 137 | + - do: |
| 138 | + catch: /illegal_argument_exception/ |
| 139 | + cluster.allocation_explain: |
| 140 | + body: { "index": "test", "shard": "1.0", "primary": true } |
| 141 | + |
| 142 | + |
77 | 143 | --- |
78 | 144 | "cluster shard allocation explanation test with double shard value": |
| 145 | + - requires: |
| 146 | + capabilities: |
| 147 | + - method: GET |
| 148 | + path: /_cluster/allocation/explain |
| 149 | + capabilities: [ shard_parameter_non_integer_validation ] |
| 150 | + test_runner_features: [ capabilities ] |
| 151 | + reason: Additional validation for the shard parameter was added in 9.2.0 |
| 152 | + |
79 | 153 | - do: |
80 | 154 | indices.create: |
81 | 155 | index: test |
|
84 | 158 | - match: { acknowledged: true } |
85 | 159 |
|
86 | 160 | - do: |
| 161 | + catch: /x_content_parse_exception/ |
87 | 162 | cluster.allocation_explain: |
88 | 163 | body: { "index": "test", "shard": 1.1234567891234567, "primary": true } |
89 | 164 |
|
90 | | - - match: { current_state: "started" } |
91 | | - - is_true: current_node.id |
92 | | - - match: { index: "test" } |
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 |
| 165 | +--- |
| 166 | +"cluster shard allocation explanation test with stringified double shard value": |
| 167 | + - requires: |
| 168 | + capabilities: |
| 169 | + - method: GET |
| 170 | + path: /_cluster/allocation/explain |
| 171 | + capabilities: [ shard_parameter_non_integer_validation ] |
| 172 | + test_runner_features: [ capabilities ] |
| 173 | + reason: Additional validation for the shard parameter was added in 9.2.0 |
| 174 | + |
| 175 | + - do: |
| 176 | + indices.create: |
| 177 | + index: test |
| 178 | + body: { "settings": { "index.number_of_shards": 2, "index.number_of_replicas": 0 } } |
| 179 | + |
| 180 | + - match: { acknowledged: true } |
| 181 | + |
| 182 | + - do: |
| 183 | + catch: /x_content_parse_exception/ |
| 184 | + cluster.allocation_explain: |
| 185 | + body: { "index": "test", "shard": "1.1234567891234567", "primary": true } |
| 186 | + |
99 | 187 |
|
100 | 188 | --- |
101 | 189 | "cluster shard allocation explanation test with three valid body parameters": |
|
0 commit comments