lucene-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Smiley (Jira)" <>
Subject [jira] [Commented] (SOLR-13785) Optimistic concurrency issue for nested documents
Date Fri, 01 Nov 2019 15:32:00 GMT


David Smiley commented on SOLR-13785:

It's definitely erroneous to for a child documents' ID to overlap with parent documents.  Really
_any document_... they must be unique.  When it comes to nested documents, there are no protections
here (as doing so seems expensive) so you can really shoot yourself in the foot if not careful.
 So if you take IDs from some external system, you might need to prefix or otherwise manipulate
them to ensure they are globally unique within Solr.

> Optimistic concurrency issue for nested documents
> -------------------------------------------------
>                 Key: SOLR-13785
>                 URL:
>             Project: Solr
>          Issue Type: Bug
>      Security Level: Public(Default Security Level. Issues are Public) 
>          Components: update
>            Reporter: Vishalaksh Aggarwal
>            Priority: Minor
> I am using Solr v7.7.1 in cloud mode. I was facing an issue related to optimistic concurrency:
> I have a nested document which can be updated concurrently multiple times before committing
the updates hence using __version__ to enable optimistic concurrency. During the process of
indexing, we fetch the document which we want to modify along with its __version__ , modify
it and then send it to solr along with the same __version__. However, even when I am sure
that there is no concurrent update for a particular document, the following error is still
> {noformat}
> Caused by: org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException: Error
from server at version conflict for
1111 expected=1645085633861910528 actual=1645090791527284737
> {noformat}
> Here is the explanation of why this might have happened:
> While indexing a document, when __version__ is mentioned, I believe the solr checks the
version of the already existing latest document by doing a real-time get.
> Now if you have 2 nested documents where, in one document (doc1), parent has id="1111"
and in other document(doc2), the child has id="1111", then it may be possible that solr might
check version of doc2 when you intended to index doc1. This might be because solr still indexes
all the documents in flat structure and doesn't consider parent-child relationship while doing
real-time get.
> For a fix, I had to make the id of parent and child documents different from each other.

This message was sent by Atlassian Jira

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message