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-16995 Add a ReplicaCount to keep track of replicas per type #1928

Merged
merged 4 commits into from
Oct 12, 2023

Conversation

pvcnt
Copy link
Contributor

@pvcnt pvcnt commented Sep 15, 2023

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

Description

Working with replica counts, i.e., the number of replicas per replica type, is currently a bit painful, as the number of replicas is tracked individually for every replica type via individual variables. Solving this issue is also a step towards making it easier to add new replica types.

Solution

This PR introduces a ReplicaCount class (there was one up to Solr 8.x in the autoscaling framework, but it was removed in Solr 9) that is fancy wrapper around a Map<Replica.Type, Integer>.

Tests

New tests for the ReplicaCount class. Existing tests ensure non-regression (there is no added feature).

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

@pvcnt pvcnt marked this pull request as ready for review September 15, 2023 10:10
@janhoy
Copy link
Contributor

janhoy commented Sep 22, 2023

I think this can benefit from a JIRA issue?

@pvcnt
Copy link
Contributor Author

pvcnt commented Sep 25, 2023

@janhoy You're right, I created one: https://issues.apache.org/jira/browse/SOLR-16995

@dsmiley
Copy link
Contributor

dsmiley commented Oct 4, 2023

Furthermore, PRs titles must start with a JIRA reference (assuming there is one); that's how they are linked. I'll change that now.

@dsmiley dsmiley changed the title Add a ReplicaCount to keep track of replicas per type SOLR-16995 Add a ReplicaCount to keep track of replicas per type Oct 4, 2023
Copy link
Contributor

@dsmiley dsmiley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 Love this!

@pvcnt pvcnt force-pushed the replica-count branch 2 times, most recently from c4d54ec to 9818111 Compare October 5, 2023 07:55
@pvcnt
Copy link
Contributor Author

pvcnt commented Oct 5, 2023

I split the changes related to using leaderEligible more into a separate PR: #1981

@dsmiley
Copy link
Contributor

dsmiley commented Oct 12, 2023

HdfsCloudIncrementalBackupTest has been flapping since 2022-08, and lately steadily increasing.

@dsmiley dsmiley merged commit 92ca38e into apache:main Oct 12, 2023
2 of 3 checks passed
@pvcnt pvcnt deleted the replica-count branch November 1, 2023 14:20
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.

4 participants