Modified indices shard count as global count And add Test in indicesS… #37644
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As we see this PR: #35931
#35931
When i use elasticsearch we met the same questions about shard path selection.
Originally, ES chose the multi path only consider about local index shard into {dataPathToShardCount}, but when multi shard created it is prefer to consider about global shard count in data Paths, as we wanna make good use of IO performance
I checked the PR #35931 mentioned above, it is too complicated.
As the code has considered about shard count, so this commit just reuse "dataPathToShardCount", it take all indices shard into consideration and this can modified less code,get more efficient.
At the same time, I added a new test case, which is IndicesShardPathSingleNodeTests , in indices tests to verify it: When we use 2 paths, and create 2 indices with 1 shard, 0 replications. In original method, it may let 2 shards assign into 1 path. In this commits, it may let 2 shards assign into 2 paths.
Thanks
yunchenglu