You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by "John Wooden (Jira)" <ji...@apache.org> on 2021/04/12 16:32:00 UTC
[jira] [Resolved] (SOLR-14326) Number of tlog replicas off by one
when restoring collections
[ https://issues.apache.org/jira/browse/SOLR-14326?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
John Wooden resolved SOLR-14326.
--------------------------------
Fix Version/s: 8.9
main (9.0)
Resolution: Fixed
> Number of tlog replicas off by one when restoring collections
> -------------------------------------------------------------
>
> Key: SOLR-14326
> URL: https://issues.apache.org/jira/browse/SOLR-14326
> Project: Solr
> Issue Type: Bug
> Components: Backup/Restore
> Affects Versions: 7.7.2, 8.0
> Reporter: John Wooden
> Priority: Minor
> Fix For: main (9.0), 8.9
>
> Time Spent: 20m
> Remaining Estimate: 0h
>
> 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.
> {quote}/admin/collections?action=RESTORE&name=<NAME>&location=<PATH>&collection=<COLLECTION>&tlogReplicas=1&pullReplicas=1
> {quote}
> Despite the backup AND/OR the request specifying 1 Tlog & 1 Pull replica, this request will create 2 Tlog replicas. On a 2-node cluster with maxShardsPerNode=1, the 1 pull replica is never created due to the excess tlog replica meeting the maxShardsPerNode limit.
>
> 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.
>
> {quote}int createdNrtReplicas = 0, {color:#de350b}createdTlogReplicas = 0{color}, createdPullReplicas = 0;
> // We already created either a NRT or an TLOG replica as leader
> if (numNrtReplicas > 0) {
> createdNrtReplicas++;
> } else if ({color:#de350b}createdTlogReplicas > 0{color}) {
> createdTlogReplicas++;
> }
> {quote}
>
>
>
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org