You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Ansgar Wiechers <so...@planetcobalt.net> on 2018/01/04 15:07:39 UTC

Replication Factor Bug in Collections Restore API?

Hi all.

I'm running Solr 7.1 in SolrCloud mode ona a 3-node cluster and tried
using the backup/restore API for the first time. Backup worked fine, but
when trying to restore the backed-up collection I ran into an unexpected
problem with the replication factor setting.

Below command attempts to restore a backup of the collection "demo" with
3 shards, creating 2 replicas per shard:

# curl -s -k 'https://localhost:8983/solr/admin/collections?action=restore&name=demo&location=/srv/backup/solr/solr-dev&collection=demo&maxShardsPerNode=2&replicationFactor=2'
{
  "error": {
    "code": 400,
    "msg": "Solr cloud with available number of nodes:3 is insufficient for restoring a collection with 3 shards, total replicas per shard 6 and maxShardsPerNode 2. Consider increasing maxShardsPerNode value OR number of available nodes.",
    "metadata": [
      "error-class",
      "org.apache.solr.common.SolrException",
      "root-error-class",
      "org.apache.solr.common.SolrException"
    ]
  },
  "exception": {
    "rspCode": 400,
    "msg": "Solr cloud with available number of nodes:3 is insufficient for restoring a collection with 3 shards, total replicas per shard 6 and maxShardsPerNode 2. Consider increasing maxShardsPerNode value OR number of available nodes."
  },
  "Operation restore caused exception:": "org.apache.solr.common.SolrException:org.apache.solr.common.SolrException: Solr cloud with available number of nodes:3 is insufficient for restoring a collection with 3 shards, total replicas per shard 6 and maxShardsPerNode 2. Consider increasing maxShardsPerNode value OR number of available nodes.",
  "responseHeader": {
    "QTime": 28,
    "status": 400
  }
}

It looks to me like the restore API multiplies the replication factor
with the number of nodes, which is not how the replication factor
behaves in other contexts. The documentation[1] also didn't lead me to
expect this behavior:

> replicationFactor
>
>    The number of replicas to be created for each shard.

Is this expected behavior (by anyone but me)?
Should I report it as a bug?

[1]: https://lucene.apache.org/solr/guide/7_1/collections-api.html

Regards
Ansgar Wiechers
-- 
"Abstractions save us time working, but they don't save us time learning."
--Joel Spolsky

Re: Replication Factor Bug in Collections Restore API?

Posted by Ansgar Wiechers <so...@planetcobalt.net>.
On 2018-01-04 Shalin Shekhar Mangar wrote:
> Sounds like a bug. Can you please open a Jira issue?

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

Regards
Ansgar Wiechers

Re: Replication Factor Bug in Collections Restore API?

Posted by Shalin Shekhar Mangar <sh...@gmail.com>.
Sounds like a bug. Can you please open a Jira issue?

On Thu, Jan 4, 2018 at 8:37 PM, Ansgar Wiechers
<so...@planetcobalt.net> wrote:
> Hi all.
>
> I'm running Solr 7.1 in SolrCloud mode ona a 3-node cluster and tried
> using the backup/restore API for the first time. Backup worked fine, but
> when trying to restore the backed-up collection I ran into an unexpected
> problem with the replication factor setting.
>
> Below command attempts to restore a backup of the collection "demo" with
> 3 shards, creating 2 replicas per shard:
>
> # curl -s -k 'https://localhost:8983/solr/admin/collections?action=restore&name=demo&location=/srv/backup/solr/solr-dev&collection=demo&maxShardsPerNode=2&replicationFactor=2'
> {
>   "error": {
>     "code": 400,
>     "msg": "Solr cloud with available number of nodes:3 is insufficient for restoring a collection with 3 shards, total replicas per shard 6 and maxShardsPerNode 2. Consider increasing maxShardsPerNode value OR number of available nodes.",
>     "metadata": [
>       "error-class",
>       "org.apache.solr.common.SolrException",
>       "root-error-class",
>       "org.apache.solr.common.SolrException"
>     ]
>   },
>   "exception": {
>     "rspCode": 400,
>     "msg": "Solr cloud with available number of nodes:3 is insufficient for restoring a collection with 3 shards, total replicas per shard 6 and maxShardsPerNode 2. Consider increasing maxShardsPerNode value OR number of available nodes."
>   },
>   "Operation restore caused exception:": "org.apache.solr.common.SolrException:org.apache.solr.common.SolrException: Solr cloud with available number of nodes:3 is insufficient for restoring a collection with 3 shards, total replicas per shard 6 and maxShardsPerNode 2. Consider increasing maxShardsPerNode value OR number of available nodes.",
>   "responseHeader": {
>     "QTime": 28,
>     "status": 400
>   }
> }
>
> It looks to me like the restore API multiplies the replication factor
> with the number of nodes, which is not how the replication factor
> behaves in other contexts. The documentation[1] also didn't lead me to
> expect this behavior:
>
>> replicationFactor
>>
>>    The number of replicas to be created for each shard.
>
> Is this expected behavior (by anyone but me)?
> Should I report it as a bug?
>
> [1]: https://lucene.apache.org/solr/guide/7_1/collections-api.html
>
> Regards
> Ansgar Wiechers
> --
> "Abstractions save us time working, but they don't save us time learning."
> --Joel Spolsky



-- 
Regards,
Shalin Shekhar Mangar.