You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Varun Thacker (JIRA)" <ji...@apache.org> on 2017/12/31 01:17:00 UTC

[jira] [Commented] (SOLR-11676) nrt replicas is always 1 when not specified

    [ https://issues.apache.org/jira/browse/SOLR-11676?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16307025#comment-16307025 ] 

Varun Thacker commented on SOLR-11676:
--------------------------------------

I ran into this while doing a simple restore.

Steps to reproduce:

1. ./bin/solr start -e cloud -noprompt : This creates a 2 node cluster and a gettingstarted collection which 2X2
2. Added 4 docs (id=1,2,3,4) with commit=true and openSearcher=true (default)
3. Call backup: http://localhost:8983/solr/admin/collections?action=BACKUP&name=gettingstarted_backup&collection=gettingstarted&location=/Users/varunthacker/solr-7.1.0
4. Call restore:
http://localhost:8983/solr/admin/collections?action=restore&name=gettingstarted_backup&collection=restore_gettingstarted&location=/Users/varunthacker/solr-7.1.0

At step 4, you'll get an error saying {{Solr cloud with available number of nodes:2 is insufficient for restoring a collection with 2 shards, total replicas per shard 1 and maxShardsPerNode -1. Consider increasing maxShardsPerNode value OR number of available nodes.}}

The restore test doesn't catch this because in the test we always explicitly specify maxShardsPerNode ( https://github.com/apache/lucene-solr/blob/master/solr/core/src/test/org/apache/solr/cloud/AbstractCloudBackupRestoreTestCase.java#L256 )

When I look at the state.json of gettingstarted it has

{code}
{"gettingstarted":{
    "pullReplicas":"0",
    "replicationFactor":"2",
    "router":{"name":"compositeId"},
    "maxShardsPerNode":"-1",
    "autoAddReplicas":"false",
    "nrtReplicas":"1",
    "tlogReplicas":"0",
    "shards":{
...
{code}

I think there are two problems here : 
a> nrtReplicas should be 2 
b> maxShardsPerNode should be 2 

> nrt replicas is always 1 when not specified
> -------------------------------------------
>
>                 Key: SOLR-11676
>                 URL: https://issues.apache.org/jira/browse/SOLR-11676
>             Project: Solr
>          Issue Type: Bug
>      Security Level: Public(Default Security Level. Issues are Public) 
>            Reporter: Varun Thacker
>         Attachments: SOLR-11676.patch
>
>
> I created 1 2 shard X 2 replica collection . Here's the log entry for it
> {code}
> 2017-11-27 06:43:47.071 INFO  (qtp159259014-22) [   ] o.a.s.h.a.CollectionsHandler Invoked Collection Action :create with params replicationFactor=2&routerName=compositeId&collection.configName=_default&maxShardsPerNode=2&name=test_recovery&router.name=compositeId&action=CREATE&numShards=2&wt=json&_=1511764995711 and sendToOCPQueue=true
> {code}
> And then when I look at the state.json file I see nrtReplicas is set to 1. Any combination of numShards and replicationFactor without explicitly specifying the "nrtReplicas" param puts the "nrtReplicas" as 1 instead of using the replicationFactor value
> {code}
> {"test_recovery":{
>     "pullReplicas":"0",
>     "replicationFactor":"2",
> ...
>     "nrtReplicas":"1",
>     "tlogReplicas":"0",
> ..
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org