Re: Unable to RESTORE collections via Collections API

2020-04-16 Thread Jan Høydahl
Thanks for sharing your workaround!

Agree that error message is extremely unhelpful :)
Would you care to report it as a bug in JIRA?

Jan

> 15. apr. 2020 kl. 21:54 skrev Eugene Livis :
> 
> In case this helps somebody in the future, given how completely unhelpful
> the Solr error message is - turns out the problem was occurring because in
> solrconfig.xml the  updateLog was disabled. I have enabled  updateLog the
> following way and "restore" operation started working:
> 
>
>  ${solr.ulog.dir:}
>   name="numVersionBuckets">${solr.ulog.numVersionBuckets:65536}
>
> 
> 
> On Wed, Apr 8, 2020 at 5:17 PM Eugene Livis  wrote:
> 
>> Hello,
>> 
>> I have been unsuccessfully trying to find a way to restore a collection
>> using the Collections API for the last several days. *I would
>> greatly appreciate any help as I am now stuck.* I am using Solr 8.2 in
>> cloud mode. To simplify things, I have only a single Solr node on my local
>> machine (though I have also tried multi-node setups). I am able to
>> successfully create collections, index documents, and run searches against
>> the index. General gist of what I am trying to do is to be able to backup
>> an existing collection, delete that collection, and then restore the
>> collection from backup when needed. Our use case requires creating
>> thousands of collections, which I believe is highly not recommended in Solr
>> Cloud (is that correct?), so this backup-delete-restore mechanism is our
>> way of reducing the number of collections in Solr at any given time. Just
>> FYI, in our use case it is ok for searches to take a couple of minutes to
>> produce results.
>> 
>> So far I have not been able to restore a single collection using the
>> collection RESTORE API. I am able to create backups by running the
>> following HTTP command in Solr admin console:
>> 
>> 
>> http://localhost:8983/solr/admin/collections?action=BACKUP=test1_backup2=test1_20200407_170438_20200407_170441=C:\TEST\DELETE\BACKUPS
>> 
>> 
>> The backup appears to be successfully created. It contains a snapshot from
>> "shard1", which is the only shard in the cluster. It also contains the
>> "zk_backup" directory, which contains my Solr config and
>> "collection_state.json" file. And it contains a "backup.properties" file.
>> Everything looks good to me.
>> 
>> However, when I attempt to restore the collection using the following HTTP
>> command:
>> 
>> 
>> http://localhost:8983/solr/admin/collections?action=RESTORE=test1_backup2=C:\TEST\DELETE\BACKUPS=test1_backup_NEW
>> 
>> 
>> I get the same extremely vague error messages in Solr logs:
>> 
>> 
>> *RequestHandlerBase org.apache.solr.common.SolrException: Error CREATEing
>> SolrCore 'test1_backup_NEW_shard1_replica_n1': Unable to create core
>> [test1_backup_NEW_shard1_replica_n1] Caused by: nullERROR
>> (qtp1099855928-24) [c:test1_backup_NEW   ] o.a.s.s.HttpSolrCall
>> null:org.apache.solr.common.SolrException: ADDREPLICA failed to create
>> replica   *
>> 
>> Below is the full Solr log of the restore command:
>> 
>> 2020-04-08 21:10:56.753 INFO  (qtp1099855928-24) [   ]
>> o.a.s.h.a.CollectionsHandler Invoked Collection Action :restore with params
>> name=test1_backup2=RESTORE=C:\TEST\DELETE\BACKUPS=test1_backup_NEW
>> and sendToOCPQueue=true
>> 2020-04-08 21:10:56.783 INFO
>> (OverseerThreadFactory-9-thread-1-processing-n:localhost:8983_solr)
>> [c:test1_backup_NEW   ] o.a.s.c.a.c.RestoreCmd Using existing config
>> AutopsyConfig
>> 2020-04-08 21:10:56.783 INFO
>> (OverseerThreadFactory-9-thread-1-processing-n:localhost:8983_solr)
>> [c:test1_backup_NEW   ] o.a.s.c.a.c.RestoreCmd Starting restore into
>> collection=test1_backup_NEW with backup_name=test1_backup2 at
>> location=file:///C:/TEST/DELETE/BACKUPS/
>> 2020-04-08 21:10:56.784 INFO
>> (OverseerThreadFactory-9-thread-1-processing-n:localhost:8983_solr)
>> [c:test1_backup_NEW   ] o.a.s.c.a.c.CreateCollectionCmd Create collection
>> test1_backup_NEW
>> 2020-04-08 21:10:56.900 WARN
>> (OverseerThreadFactory-9-thread-1-processing-n:localhost:8983_solr)
>> [c:test1_backup_NEW   ] o.a.s.c.a.c.CreateCollectionCmd It is unusual to
>> create a collection (test1_backup_NEW) without cores.
>> 2020-04-08 21:10:56.908 INFO
>> (OverseerStateUpdate-72057883336638464-localhost:8983_solr-n_03) [
>>  ] o.a.s.c.o.SliceMutator Update shard state invoked for collection:
>> test1_backup_NEW with message: {
>>  "shard1":"construction",
>>  "collection":"test1_backup_NEW",
>>  "operation":"updateshardstate"}
>> 2020-04-08 21:10:56.908 INFO
>> (OverseerStateUpdate-72057883336638464-localhost:8983_solr-n_03) [
>>  ] o.a.s.c.o.SliceMutator Update shard state shard1 to construction
>> 2020-04-08 21:10:56.925 INFO
>> (OverseerThreadFactory-9-thread-1-processing-n:localhost:8983_solr)
>> [c:test1_backup_NEW   ] o.a.s.c.a.c.RestoreCmd Adding replica for
>> shard=shard1
>> collection=DocCollection(test1_backup_NEW//collections/test1_backup_NEW/state.json/0)={
>>  "pullReplicas":0,
>>  

Re: Unable to RESTORE collections via Collections API

2020-04-15 Thread Eugene Livis
In case this helps somebody in the future, given how completely unhelpful
the Solr error message is - turns out the problem was occurring because in
solrconfig.xml the  updateLog was disabled. I have enabled  updateLog the
following way and "restore" operation started working:


  ${solr.ulog.dir:}
  ${solr.ulog.numVersionBuckets:65536}



On Wed, Apr 8, 2020 at 5:17 PM Eugene Livis  wrote:

> Hello,
>
> I have been unsuccessfully trying to find a way to restore a collection
> using the Collections API for the last several days. *I would
> greatly appreciate any help as I am now stuck.* I am using Solr 8.2 in
> cloud mode. To simplify things, I have only a single Solr node on my local
> machine (though I have also tried multi-node setups). I am able to
> successfully create collections, index documents, and run searches against
> the index. General gist of what I am trying to do is to be able to backup
> an existing collection, delete that collection, and then restore the
> collection from backup when needed. Our use case requires creating
> thousands of collections, which I believe is highly not recommended in Solr
> Cloud (is that correct?), so this backup-delete-restore mechanism is our
> way of reducing the number of collections in Solr at any given time. Just
> FYI, in our use case it is ok for searches to take a couple of minutes to
> produce results.
>
> So far I have not been able to restore a single collection using the
> collection RESTORE API. I am able to create backups by running the
> following HTTP command in Solr admin console:
>
>
> http://localhost:8983/solr/admin/collections?action=BACKUP=test1_backup2=test1_20200407_170438_20200407_170441=C:\TEST\DELETE\BACKUPS
>
>
> The backup appears to be successfully created. It contains a snapshot from
> "shard1", which is the only shard in the cluster. It also contains the
> "zk_backup" directory, which contains my Solr config and
> "collection_state.json" file. And it contains a "backup.properties" file.
> Everything looks good to me.
>
> However, when I attempt to restore the collection using the following HTTP
> command:
>
>
> http://localhost:8983/solr/admin/collections?action=RESTORE=test1_backup2=C:\TEST\DELETE\BACKUPS=test1_backup_NEW
>
>
> I get the same extremely vague error messages in Solr logs:
>
>
> *RequestHandlerBase org.apache.solr.common.SolrException: Error CREATEing
> SolrCore 'test1_backup_NEW_shard1_replica_n1': Unable to create core
> [test1_backup_NEW_shard1_replica_n1] Caused by: nullERROR
> (qtp1099855928-24) [c:test1_backup_NEW   ] o.a.s.s.HttpSolrCall
> null:org.apache.solr.common.SolrException: ADDREPLICA failed to create
> replica   *
>
> Below is the full Solr log of the restore command:
>
> 2020-04-08 21:10:56.753 INFO  (qtp1099855928-24) [   ]
> o.a.s.h.a.CollectionsHandler Invoked Collection Action :restore with params
> name=test1_backup2=RESTORE=C:\TEST\DELETE\BACKUPS=test1_backup_NEW
> and sendToOCPQueue=true
> 2020-04-08 21:10:56.783 INFO
>  (OverseerThreadFactory-9-thread-1-processing-n:localhost:8983_solr)
> [c:test1_backup_NEW   ] o.a.s.c.a.c.RestoreCmd Using existing config
> AutopsyConfig
> 2020-04-08 21:10:56.783 INFO
>  (OverseerThreadFactory-9-thread-1-processing-n:localhost:8983_solr)
> [c:test1_backup_NEW   ] o.a.s.c.a.c.RestoreCmd Starting restore into
> collection=test1_backup_NEW with backup_name=test1_backup2 at
> location=file:///C:/TEST/DELETE/BACKUPS/
> 2020-04-08 21:10:56.784 INFO
>  (OverseerThreadFactory-9-thread-1-processing-n:localhost:8983_solr)
> [c:test1_backup_NEW   ] o.a.s.c.a.c.CreateCollectionCmd Create collection
> test1_backup_NEW
> 2020-04-08 21:10:56.900 WARN
>  (OverseerThreadFactory-9-thread-1-processing-n:localhost:8983_solr)
> [c:test1_backup_NEW   ] o.a.s.c.a.c.CreateCollectionCmd It is unusual to
> create a collection (test1_backup_NEW) without cores.
> 2020-04-08 21:10:56.908 INFO
>  (OverseerStateUpdate-72057883336638464-localhost:8983_solr-n_03) [
>   ] o.a.s.c.o.SliceMutator Update shard state invoked for collection:
> test1_backup_NEW with message: {
>   "shard1":"construction",
>   "collection":"test1_backup_NEW",
>   "operation":"updateshardstate"}
> 2020-04-08 21:10:56.908 INFO
>  (OverseerStateUpdate-72057883336638464-localhost:8983_solr-n_03) [
>   ] o.a.s.c.o.SliceMutator Update shard state shard1 to construction
> 2020-04-08 21:10:56.925 INFO
>  (OverseerThreadFactory-9-thread-1-processing-n:localhost:8983_solr)
> [c:test1_backup_NEW   ] o.a.s.c.a.c.RestoreCmd Adding replica for
> shard=shard1
> collection=DocCollection(test1_backup_NEW//collections/test1_backup_NEW/state.json/0)={
>   "pullReplicas":0,
>   "replicationFactor":1,
>   "shards":{"shard1":{
>   "range":"8000-7fff",
>   "state":"active",
>   "replicas":{}}},
>   "router":{"name":"compositeId"},
>   "maxShardsPerNode":"1",
>   "autoAddReplicas":"false",
>   "nrtReplicas":1,
>   "tlogReplicas":0}
> 2020-04-08 21:10:56.928 INFO
>  

Unable to RESTORE collections via Collections API

2020-04-08 Thread Eugene Livis
Hello,

I have been unsuccessfully trying to find a way to restore a collection
using the Collections API for the last several days. *I would
greatly appreciate any help as I am now stuck.* I am using Solr 8.2 in
cloud mode. To simplify things, I have only a single Solr node on my local
machine (though I have also tried multi-node setups). I am able to
successfully create collections, index documents, and run searches against
the index. General gist of what I am trying to do is to be able to backup
an existing collection, delete that collection, and then restore the
collection from backup when needed. Our use case requires creating
thousands of collections, which I believe is highly not recommended in Solr
Cloud (is that correct?), so this backup-delete-restore mechanism is our
way of reducing the number of collections in Solr at any given time. Just
FYI, in our use case it is ok for searches to take a couple of minutes to
produce results.

So far I have not been able to restore a single collection using the
collection RESTORE API. I am able to create backups by running the
following HTTP command in Solr admin console:

http://localhost:8983/solr/admin/collections?action=BACKUP=test1_backup2=test1_20200407_170438_20200407_170441=C:\TEST\DELETE\BACKUPS


The backup appears to be successfully created. It contains a snapshot from
"shard1", which is the only shard in the cluster. It also contains the
"zk_backup" directory, which contains my Solr config and
"collection_state.json" file. And it contains a "backup.properties" file.
Everything looks good to me.

However, when I attempt to restore the collection using the following HTTP
command:

http://localhost:8983/solr/admin/collections?action=RESTORE=test1_backup2=C:\TEST\DELETE\BACKUPS=test1_backup_NEW


I get the same extremely vague error messages in Solr logs:


*RequestHandlerBase org.apache.solr.common.SolrException: Error CREATEing
SolrCore 'test1_backup_NEW_shard1_replica_n1': Unable to create core
[test1_backup_NEW_shard1_replica_n1] Caused by: nullERROR
(qtp1099855928-24) [c:test1_backup_NEW   ] o.a.s.s.HttpSolrCall
null:org.apache.solr.common.SolrException: ADDREPLICA failed to create
replica   *

Below is the full Solr log of the restore command:

2020-04-08 21:10:56.753 INFO  (qtp1099855928-24) [   ]
o.a.s.h.a.CollectionsHandler Invoked Collection Action :restore with params
name=test1_backup2=RESTORE=C:\TEST\DELETE\BACKUPS=test1_backup_NEW
and sendToOCPQueue=true
2020-04-08 21:10:56.783 INFO
 (OverseerThreadFactory-9-thread-1-processing-n:localhost:8983_solr)
[c:test1_backup_NEW   ] o.a.s.c.a.c.RestoreCmd Using existing config
AutopsyConfig
2020-04-08 21:10:56.783 INFO
 (OverseerThreadFactory-9-thread-1-processing-n:localhost:8983_solr)
[c:test1_backup_NEW   ] o.a.s.c.a.c.RestoreCmd Starting restore into
collection=test1_backup_NEW with backup_name=test1_backup2 at
location=file:///C:/TEST/DELETE/BACKUPS/
2020-04-08 21:10:56.784 INFO
 (OverseerThreadFactory-9-thread-1-processing-n:localhost:8983_solr)
[c:test1_backup_NEW   ] o.a.s.c.a.c.CreateCollectionCmd Create collection
test1_backup_NEW
2020-04-08 21:10:56.900 WARN
 (OverseerThreadFactory-9-thread-1-processing-n:localhost:8983_solr)
[c:test1_backup_NEW   ] o.a.s.c.a.c.CreateCollectionCmd It is unusual to
create a collection (test1_backup_NEW) without cores.
2020-04-08 21:10:56.908 INFO
 (OverseerStateUpdate-72057883336638464-localhost:8983_solr-n_03) [
  ] o.a.s.c.o.SliceMutator Update shard state invoked for collection:
test1_backup_NEW with message: {
  "shard1":"construction",
  "collection":"test1_backup_NEW",
  "operation":"updateshardstate"}
2020-04-08 21:10:56.908 INFO
 (OverseerStateUpdate-72057883336638464-localhost:8983_solr-n_03) [
  ] o.a.s.c.o.SliceMutator Update shard state shard1 to construction
2020-04-08 21:10:56.925 INFO
 (OverseerThreadFactory-9-thread-1-processing-n:localhost:8983_solr)
[c:test1_backup_NEW   ] o.a.s.c.a.c.RestoreCmd Adding replica for
shard=shard1
collection=DocCollection(test1_backup_NEW//collections/test1_backup_NEW/state.json/0)={
  "pullReplicas":0,
  "replicationFactor":1,
  "shards":{"shard1":{
  "range":"8000-7fff",
  "state":"active",
  "replicas":{}}},
  "router":{"name":"compositeId"},
  "maxShardsPerNode":"1",
  "autoAddReplicas":"false",
  "nrtReplicas":1,
  "tlogReplicas":0}
2020-04-08 21:10:56.928 INFO
 (OverseerThreadFactory-9-thread-1-processing-n:localhost:8983_solr)
[c:test1_backup_NEW   ] o.a.s.c.a.c.AddReplicaCmd Node Identified
localhost:8983_solr for creating new replica of shard shard1 for collection
test1_backup_NEW
2020-04-08 21:10:56.939 INFO
 (OverseerThreadFactory-9-thread-1-processing-n:localhost:8983_solr)
[c:test1_backup_NEW   ] o.a.s.c.a.c.AddReplicaCmd Returning CreateReplica
command.
2020-04-08 21:10:56.945 INFO
 (OverseerStateUpdate-72057883336638464-localhost:8983_solr-n_03) [
  ] o.a.s.c.o.SliceMutator createReplica() {
  "operation":"addreplica",