Commit 1255c85
committed
Improve RoutingNode invariant assertion efficiency
[BalanceUnbalancedClusterTests take 10 or 11 minutes][1] in CI. The
reason is because of O(N^2) assertion behavior. This change moves the
invariant assertions out of the individual muting calls up to the
RoutingNodes level where it can do the assertion after bulk mutations.
This change is safe because assertions are only moved out of
package-private methods that are only called by RoutingNodes; the public
API of RoutingNode still enforces all the same invariants.
[1]: https://build.ci.opensearch.org/job/gradle-check/74280/testReport/org.opensearch.cluster.routing.allocation/BalanceUnbalancedClusterTests/
Signed-off-by: Andrew Ross <andrross@amazon.com>1 parent 7410452 commit 1255c85
File tree
2 files changed
+6
-7
lines changed- server/src/main/java/org/opensearch/cluster/routing
2 files changed
+6
-7
lines changedLines changed: 1 addition & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
269 | 269 | | |
270 | 270 | | |
271 | 271 | | |
272 | | - | |
273 | 272 | | |
274 | 273 | | |
275 | 274 | | |
| |||
290 | 289 | | |
291 | 290 | | |
292 | 291 | | |
293 | | - | |
294 | 292 | | |
295 | 293 | | |
296 | 294 | | |
297 | | - | |
298 | 295 | | |
299 | 296 | | |
300 | 297 | | |
| |||
320 | 317 | | |
321 | 318 | | |
322 | 319 | | |
323 | | - | |
324 | 320 | | |
325 | 321 | | |
326 | 322 | | |
327 | | - | |
328 | 323 | | |
329 | 324 | | |
330 | 325 | | |
| |||
338 | 333 | | |
339 | 334 | | |
340 | 335 | | |
341 | | - | |
342 | 336 | | |
343 | 337 | | |
344 | 338 | | |
| |||
502 | 496 | | |
503 | 497 | | |
504 | 498 | | |
505 | | - | |
| 499 | + | |
506 | 500 | | |
507 | 501 | | |
508 | 502 | | |
| |||
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
| 177 | + | |
177 | 178 | | |
178 | 179 | | |
179 | 180 | | |
| |||
563 | 564 | | |
564 | 565 | | |
565 | 566 | | |
| 567 | + | |
566 | 568 | | |
567 | 569 | | |
568 | 570 | | |
| |||
591 | 593 | | |
592 | 594 | | |
593 | 595 | | |
| 596 | + | |
594 | 597 | | |
595 | 598 | | |
596 | 599 | | |
| |||
872 | 875 | | |
873 | 876 | | |
874 | 877 | | |
| 878 | + | |
875 | 879 | | |
876 | 880 | | |
877 | 881 | | |
| |||
951 | 955 | | |
952 | 956 | | |
953 | 957 | | |
| 958 | + | |
954 | 959 | | |
955 | 960 | | |
956 | 961 | | |
| |||
0 commit comments