You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Hoss Man (JIRA)" <ji...@apache.org> on 2012/05/04 03:48:49 UTC

[jira] [Updated] (SOLR-3432) deleteByQuery silently ignored if updateLog is enabled, but {{_version_}} field does not exist in schema

     [ https://issues.apache.org/jira/browse/SOLR-3432?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Hoss Man updated SOLR-3432:
---------------------------

    Description: 
deleteByQuery is silently ignored if there the updateLog is configurd in solrconfig.xml, but there is no {{\_version\_}} field in the schema.xml (ie: if someone copies the example configs, and then prunes down the schema to remove fields they don't think they need/want)

To reproduce:
* comment out {{\_version\_}} in example schema
* {{java -jar start.jar}}
* {{java -Ddata=args -jar post.jar '<add><doc><field name="id">HOSS</field></doc></add>'}}
* {{java -Ddata=args -jar post.jar '<delete><query>id:HOSS</query></delete>'}}
** or: {{java -Ddata=args -jar post.jar '<delete><query>\*:\*</query></delete>'}}

Note in the logs that SolrCore logs the deleteByQuery, but there is no log of it executing...

{noformat}
May 3, 2012 4:36:24 PM org.apache.solr.update.processor.LogUpdateProcessor finish
INFO: [collection1] webapp=/solr path=/update params={} {deleteByQuery=*:*} 0 41
{noformat}
Workarround: add this ield to your schema.xml...

{code}
   <field name="_version_" type="long" indexed="true" stored="true"/>
{code}


  was:
deleteByQuery is silently ignored if there is no {{\_version\_}} field in the schema.xml

To reproduce:
* comment out {{\_version\_}} in example schema
* {{java -jar start.jar}}
* {{java -Ddata=args -jar post.jar '<add><doc><field name="id">HOSS</field></doc></add>'}}
* {{java -Ddata=args -jar post.jar '<delete><query>id:HOSS</query></delete>'}}
** or: {{java -Ddata=args -jar post.jar '<delete><query>\*:\*</query></delete>'}}

Note in the logs that SolrCore logs the deleteByQuery, but there is no log of it executing...

{noformat}
May 3, 2012 4:36:24 PM org.apache.solr.update.processor.LogUpdateProcessor finish
INFO: [collection1] webapp=/solr path=/update params={} {deleteByQuery=*:*} 0 41
{noformat}
Workarround: add this ield to your schema.xml...

{code}
   <field name="_version_" type="long" indexed="true" stored="true"/>
{code}


        Summary: deleteByQuery silently ignored if updateLog is enabled, but {{_version_}} field does not exist in schema   (was: deleteByQuery silently ignored unless {{_version_}} field exists in schema )

If the underlying problem is that updateLog is useless w/o a {{\_version\_}} field, then it should probably be a hard startup failure if updateLog is enabled w/o {{\_version\_}} existing.

Alternatively: given some of the problems we've seen (and will likley continue to see) with users not realizing when {{\_version\_}} is mandatory (ie: upgrading from simple solr to SolrCloud) we might consider adding to the IndexSchema automagically on startup if it isn't explicitly declared in schema.xml
                
> deleteByQuery silently ignored if updateLog is enabled, but {{_version_}} field does not exist in schema 
> ---------------------------------------------------------------------------------------------------------
>
>                 Key: SOLR-3432
>                 URL: https://issues.apache.org/jira/browse/SOLR-3432
>             Project: Solr
>          Issue Type: Bug
>         Environment: Tomcat 7
>            Reporter: David
>            Assignee: Yonik Seeley
>            Priority: Blocker
>             Fix For: 4.0
>
>         Attachments: SOLR-3432.test.patch, schema.xml, solr.xml, solrconfig.xml, web.xml
>
>
> deleteByQuery is silently ignored if there the updateLog is configurd in solrconfig.xml, but there is no {{\_version\_}} field in the schema.xml (ie: if someone copies the example configs, and then prunes down the schema to remove fields they don't think they need/want)
> To reproduce:
> * comment out {{\_version\_}} in example schema
> * {{java -jar start.jar}}
> * {{java -Ddata=args -jar post.jar '<add><doc><field name="id">HOSS</field></doc></add>'}}
> * {{java -Ddata=args -jar post.jar '<delete><query>id:HOSS</query></delete>'}}
> ** or: {{java -Ddata=args -jar post.jar '<delete><query>\*:\*</query></delete>'}}
> Note in the logs that SolrCore logs the deleteByQuery, but there is no log of it executing...
> {noformat}
> May 3, 2012 4:36:24 PM org.apache.solr.update.processor.LogUpdateProcessor finish
> INFO: [collection1] webapp=/solr path=/update params={} {deleteByQuery=*:*} 0 41
> {noformat}
> Workarround: add this ield to your schema.xml...
> {code}
>    <field name="_version_" type="long" indexed="true" stored="true"/>
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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