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

SOLR-17076: Optimize placement factory get all replica #165

Conversation

patsonluk
Copy link
Collaborator

@patsonluk patsonluk commented Nov 15, 2023

https://issues.apache.org/jira/browse/SOLR-17076

Description

OrderedNodePlacementPlugin#getAllReplicasOnNode can be slow in a cluster with lot of replicas. The effect could compound with new collection creation with many shards.

Solution

Introduced a new field allReplicas which keeps track of all the replicas added/removed in the Plugin. Return a copy of that set instead for getAllReplicasOnNode.

Also added a new convenient method getAllReplicaCount if only the count is needed

Tests

A minor change, rely on existing unit test case

Checklist

Please review the following and check all that apply:

  • I have reviewed the guidelines for How to Contribute and my code conforms to the standards described there to the best of my ability.
  • I have created a Jira issue and added the issue ID to my pull request title.
  • I have given Solr maintainers access to contribute to my PR branch. (optional but recommended)
  • I have developed this patch against the main branch.
  • I have run ./gradlew check.
  • I have added tests for my changes.
  • I have added documentation for the Reference Guide

…` field, which keeps track of all replicas. Instead of computing a new list every time.

2. Added a getAllReplicaCount method to avoid creating new list of replicas if only the count is required
@patsonluk
Copy link
Collaborator Author

Somehow opened against our main instead of apache's....closing this!

@patsonluk patsonluk closed this Nov 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant