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

David Smiley commented on SOLR-12065:
-------------------------------------

An observation I have, years later, is that it feels really strange to call 
REQUESTAPPLYUPDATES on the restored replicas because _there is no update log_!  
Well technically there is but it's empty, newly created, because we don't 
backup / restore the update log.  AFAICT this is being called because of the 
side effects this command has.  It switches the internal state of the UpdateLog 
 from BUFFERING to ACTIVE 
(org.apache.solr.update.UpdateLog#applyBufferedUpdates).  It also publishes the 
replica as ACTIVE when done, which probably isn't pertinent here since 
RestoreCmd sets them ACTIVE at the end any way.  Apparently, a newly created 
Core of a SolrCloud Collection has its updateLog in buffering state 
(org.apache.solr.core.SolrCore#bufferUpdatesIfConstructing).  

I propose instead that RESTORECORE call applyBufferedUpdates() (locally) and 
document why it is doing so.  Document that we don't have any buffered updates 
but that we need to transition the state to ACTIVE.  

> Restore replica always in buffering state
> -----------------------------------------
>
>                 Key: SOLR-12065
>                 URL: https://issues.apache.org/jira/browse/SOLR-12065
>             Project: Solr
>          Issue Type: Bug
>          Components: Backup/Restore
>            Reporter: Varun Thacker
>            Assignee: Varun Thacker
>            Priority: Major
>             Fix For: 7.3.1, 7.4, 8.0
>
>         Attachments: 12065.patch, 12605UTLogs.txt.zip, SOLR-12065.patch, 
> SOLR-12065.patch, SOLR-12065.patch, SOLR-12065.patch, logs_and_metrics.zip, 
> restore_snippet.log
>
>
> Steps to reproduce:
>  
>  - 
> [http://localhost:8983/solr/admin/collections?action=CREATE&name=test_backup&numShards=1&nrtReplicas=1]
>  - curl [http://127.0.0.1:8983/solr/test_backup/update?commit=true] -H 
> 'Content-type:application/json' -d '
>  [ \{"id" : "1"}
> ]' 
>  - 
> [http://localhost:8983/solr/admin/collections?action=BACKUP&name=test_backup&collection=test_backup&location=/Users/varunthacker/backups]
>  - 
> [http://localhost:8983/solr/admin/collections?action=RESTORE&name=test_backup&location=/Users/varunthacker/backups&collection=test_restore]
>  * curl [http://127.0.0.1:8983/solr/test_restore/update?commit=true] -H 
> 'Content-type:application/json' -d '
>  [
> {"id" : "2"}
> ]'
>  * Snippet when you try adding a document
> {code:java}
> INFO - 2018-03-07 22:48:11.555; [c:test_restore s:shard1 r:core_node22 
> x:test_restore_shard1_replica_n21] 
> org.apache.solr.update.processor.DistributedUpdateProcessor; Ignoring commit 
> while not ACTIVE - state: BUFFERING replay: false
> INFO - 2018-03-07 22:48:11.556; [c:test_restore s:shard1 r:core_node22 
> x:test_restore_shard1_replica_n21] 
> org.apache.solr.update.processor.LogUpdateProcessorFactory$LogUpdateProcessor;
>  [test_restore_shard1_replica_n21] webapp=/solr path=/update 
> params={commit=true}{add=[2 (1594320896973078528)],commit=} 0 4{code}
>  * If you see "TLOG.state" from [http://localhost:8983/solr/admin/metrics] 
> it's always 1 (BUFFERING)
>  
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to