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 mark12345 <ma...@yahoo.com.au> on 2013/05/03 04:53:02 UTC
The HttpSolrServer "add(Collection docs)" method
is not atomic.
One thing I noticed is that while the HttpSolrServer "add(SolrInputDocument
doc)" method is atomic (Either a bean is added or an exception is thrown),
the HttpSolrServer "add(Collection<SolrInputDocument> docs)" method is not
atomic.
Question: Is there a way to commit multiple documents/beans in a
transaction/together in a way that it succeeds completely or fails
completely?
Quick outline of what I did to highlight a call to HttpSolrServer
"add(Collection<SolrInputDocument> docs)" method is not atomic.
1. Create 5 documents, comprising of 4 valid documents (Documents 1,2,4,5)
and 1 document with an issue, document 3.
2. Call to HttpSolrServer "add(Collection<SolrInputDocument> docs)" which
threw a SolrException.
3. Call to HttpSolrServer "commit()".
4. Discovered that 2 out of 5 (documents 1 and 2) documents where still
commited.
--
View this message in context: http://lucene.472066.n3.nabble.com/SolrJ-Solr-Two-Phase-Commit-tp4060399p4060590.html
Sent from the Solr - User mailing list archive at Nabble.com.
Re: The HttpSolrServer "add(Collection docs)"
method is not atomic.
Posted by Erick Erickson <er...@gmail.com>.
bq: Is there a way to commit multiple documents/beans in a
transaction/together in a way that it succeeds completely or fails
completely?
Not that I know of. I've seen various "divide and conquer" strategies
to identify _which_ document failed, but the general process
is usually to re-index the docs in smaller chunks until you
isolate the offending one and trust that re-indexing documents will
be OK since it overwrites the earlier copiy.
Best
Erick
On Thu, May 2, 2013 at 7:53 PM, mark12345 <ma...@yahoo.com.au> wrote:
> One thing I noticed is that while the HttpSolrServer "add(SolrInputDocument
> doc)" method is atomic (Either a bean is added or an exception is thrown),
> the HttpSolrServer "add(Collection<SolrInputDocument> docs)" method is not
> atomic.
>
> Question: Is there a way to commit multiple documents/beans in a
> transaction/together in a way that it succeeds completely or fails
> completely?
>
>
> Quick outline of what I did to highlight a call to HttpSolrServer
> "add(Collection<SolrInputDocument> docs)" method is not atomic.
> 1. Create 5 documents, comprising of 4 valid documents (Documents 1,2,4,5)
> and 1 document with an issue, document 3.
> 2. Call to HttpSolrServer "add(Collection<SolrInputDocument> docs)" which
> threw a SolrException.
> 3. Call to HttpSolrServer "commit()".
> 4. Discovered that 2 out of 5 (documents 1 and 2) documents where still
> commited.
>
>
>
>
> --
> View this message in context: http://lucene.472066.n3.nabble.com/SolrJ-Solr-Two-Phase-Commit-tp4060399p4060590.html
> Sent from the Solr - User mailing list archive at Nabble.com.