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-14326 Number of tlog replicas off by one when restoring collections #1348

Closed
wants to merge 1 commit into from

Conversation

CBWallaby
Copy link

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

When making a request to restore a collection, the quantity of tlog replicas will always be off by one when restoring a collection that doesn't contain nrt replicas or when specifying the quantity of replicas in the request itself.

This is due to a flawed comparison where an int meant to be an iterator for tlog replicas is checked if it is greater than zero, however, since that variable was initialized as 0 just prior it will never be greater than zero. The fix is to compare the desired number of tlog replicas (like nrt) rather than the iterator.

@madrob
Copy link
Contributor

madrob commented Mar 27, 2020

Thanks for finding this and taking the time to post a patch! Could you add a test to demonstrate that this fixes the issue and prevent future regressions? Also, can you generate a PR against master and then we will back port from there? I think we are unlikely to see any more releases on the 7.x branch in the future.

@CBWallaby CBWallaby closed this Apr 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants