Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Weighted Shard Routing] Revisit weighted routing cache #4525

Closed
anshu1106 opened this issue Sep 15, 2022 · 2 comments
Closed

[Weighted Shard Routing] Revisit weighted routing cache #4525

anshu1106 opened this issue Sep 15, 2022 · 2 comments
Labels
enhancement Enhancement or improvement to existing feature or request Indexing & Search

Comments

@anshu1106
Copy link
Contributor

anshu1106 commented Sep 15, 2022

Describe the solution you'd like
Revisit WeightedRoutingCache and see if we can make it more optimal. Currently the cache is invalidated on every cluster state change which is not needed and can affect performance.

  • Check if we can leverage AttributeRoutings which is invalidated only on change in shard routing.
 static class AttributesRoutings {

        public final List<ShardRouting> withSameAttribute;
        public final List<ShardRouting> withoutSameAttribute;
        public final int totalSize;

        AttributesRoutings(List<ShardRouting> withSameAttribute, List<ShardRouting> withoutSameAttribute) {
            this.withSameAttribute = withSameAttribute;
            this.withoutSameAttribute = withoutSameAttribute;
            this.totalSize = withoutSameAttribute.size() + withSameAttribute.size();
        }
    }
  • Make WeightedRoutingCache more performant.
@anshu1106 anshu1106 added enhancement Enhancement or improvement to existing feature or request untriaged labels Sep 15, 2022
@anshu1106
Copy link
Contributor Author

anshu1106 commented Sep 15, 2022

@anshu1106
Copy link
Contributor Author

Closing this issue. This is fixed in 4241

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement or improvement to existing feature or request Indexing & Search
Projects
None yet
Development

No branches or pull requests

2 participants