lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Amrit Sarkar <sarkaramr...@gmail.com>
Subject Re: atomic updates in conjunction with optimistic concurrency
Date Fri, 21 Jul 2017 20:33:22 GMT
Hendrik,

Ran a little test on 6.3, with infinite atomic updates with optimistic
concurrency,
cannot *reproduce*:

List<SolrInputDocument> docs = new ArrayList<>();
> SolrInputDocument document = new SolrInputDocument();
> document.addField("id", String.valueOf(1));
> document.addField("external_version_field_s", System.currentTimeMillis()); // normal
update
> docs.add(document);
> UpdateRequest updateRequest = new UpdateRequest();
> updateRequest.add(docs);
> client.request(updateRequest, collection);
> updateRequest = new UpdateRequest();
> updateRequest.commit(client, collection);
>
> while (true) {
>     QueryResponse response = client.query(new ModifiableSolrParams().add("q", "id:1"));
>     System.out.println(response.getResults().get(0).get("_version_"));
>     docs = new ArrayList<>();
>     document = new SolrInputDocument();
>     document.addField("id", String.valueOf(1));
>     Map<String, String> map = new HashMap<>();
>     map.put("set", createSentance(1)); // atomic map value
>     document.addField("external_version_field_s", map);
>     document.addField("_version_", response.getResults().get(0).get("_version_"));
>     docs.add(document);
>     updateRequest = new UpdateRequest();
>     updateRequest.add(docs);
>     client.request(updateRequest, collection);
>     updateRequest = new UpdateRequest();
>     updateRequest.commit(client, collection);
> }
>
> Maybe you can let us know more details how the update been made?

Amrit Sarkar
Search Engineer
Lucidworks, Inc.
415-589-9269
www.lucidworks.com
Twitter http://twitter.com/lucidworks
LinkedIn: https://www.linkedin.com/in/sarkaramrit2

On Fri, Jul 21, 2017 at 10:36 PM, Hendrik Haddorp <hendrik.haddorp@gmx.net>
wrote:

> Hi,
>
> I can't find anything about this in the Solr logs. On the caller side I
> have this:
> Error from server at http://xxxxx_shard1_replica2: version conflict for
> xxxxx expected=1573538179623944192 actual=1573546159565176832
> org.apache.solr.client.solrj.impl.CloudSolrClient$RouteException: Error
> from server at http://xxxxx_shard1_replica2: version conflict for xxxxx
> expected=1573538179623944192 actual=1573546159565176832
>     at org.apache.solr.client.solrj.impl.CloudSolrClient.directUpdate(CloudSolrClient.java:765)
> ~[solr-solrj-6.3.0.jar:6.3.0 a66a44513ee8191e25b477372094bfa846450316 -
> shalin - 2016-11-02 19:52:43]
>     at org.apache.solr.client.solrj.impl.CloudSolrClient.sendRequest(CloudSolrClient.java:1173)
> ~[solr-solrj-6.3.0.jar:6.3.0 a66a44513ee8191e25b477372094bfa846450316 -
> shalin - 2016-11-02 19:52:43]
>     at org.apache.solr.client.solrj.impl.CloudSolrClient.requestWit
> hRetryOnStaleState(CloudSolrClient.java:1062)
> ~[solr-solrj-6.3.0.jar:6.3.0 a66a44513ee8191e25b477372094bfa846450316 -
> shalin - 2016-11-02 19:52:43]
>     at org.apache.solr.client.solrj.impl.CloudSolrClient.request(CloudSolrClient.java:1004)
> ~[solr-solrj-6.3.0.jar:6.3.0 a66a44513ee8191e25b477372094bfa846450316 -
> shalin - 2016-11-02 19:52:43]
>     at org.apache.solr.client.solrj.SolrRequest.process(SolrRequest.java:149)
> ~[solr-solrj-6.3.0.jar:6.3.0 a66a44513ee8191e25b477372094bfa846450316 -
> shalin - 2016-11-02 19:52:43]
>     at org.apache.solr.client.solrj.SolrClient.add(SolrClient.java:106)
> ~[solr-solrj-6.3.0.jar:6.3.0 a66a44513ee8191e25b477372094bfa846450316 -
> shalin - 2016-11-02 19:52:43]
>     at org.apache.solr.client.solrj.SolrClient.add(SolrClient.java:71)
> ~[solr-solrj-6.3.0.jar:6.3.0 a66a44513ee8191e25b477372094bfa846450316 -
> shalin - 2016-11-02 19:52:43]
>     ...
> Caused by: org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException:
> Error from server at http://xxxxx_shard1_replica2: version conflict for
> xxxxx expected=1573538179623944192 actual=1573546159565176832
>     at org.apache.solr.client.solrj.impl.HttpSolrClient.executeMethod(HttpSolrClient.java:593)
> ~[solr-solrj-6.3.0.jar:6.3.0 a66a44513ee8191e25b477372094bfa846450316 -
> shalin - 2016-11-02 19:52:43]
>     at org.apache.solr.client.solrj.impl.HttpSolrClient.request(HttpSolrClient.java:262)
> ~[solr-solrj-6.3.0.jar:6.3.0 a66a44513ee8191e25b477372094bfa846450316 -
> shalin - 2016-11-02 19:52:43]
>     at org.apache.solr.client.solrj.impl.HttpSolrClient.request(HttpSolrClient.java:251)
> ~[solr-solrj-6.3.0.jar:6.3.0 a66a44513ee8191e25b477372094bfa846450316 -
> shalin - 2016-11-02 19:52:43]
>     at org.apache.solr.client.solrj.impl.LBHttpSolrClient.doRequest(LBHttpSolrClient.java:435)
> ~[solr-solrj-6.3.0.jar:6.3.0 a66a44513ee8191e25b477372094bfa846450316 -
> shalin - 2016-11-02 19:52:43]
>     at org.apache.solr.client.solrj.impl.LBHttpSolrClient.request(LBHttpSolrClient.java:387)
> ~[solr-solrj-6.3.0.jar:6.3.0 a66a44513ee8191e25b477372094bfa846450316 -
> shalin - 2016-11-02 19:52:43]
>     at org.apache.solr.client.solrj.impl.CloudSolrClient.lambda$dir
> ectUpdate$0(CloudSolrClient.java:742) ~[solr-solrj-6.3.0.jar:6.3.0
> a66a44513ee8191e25b477372094bfa846450316 - shalin - 2016-11-02 19:52:43]
>     at java.util.concurrent.FutureTask.run(FutureTask.java:266)
> ~[?:1.8.0_131]
>     at org.apache.solr.common.util.ExecutorUtil$MDCAwareThreadPoolE
> xecutor.lambda$execute$0(ExecutorUtil.java:229)
> ~[solr-solrj-6.3.0.jar:6.3.0 a66a44513ee8191e25b477372094bfa846450316 -
> shalin - 2016-11-02 19:52:43]
>     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
> ~[?:1.8.0_131]
>     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
> ~[?:1.8.0_131]
>     at java.lang.Thread.run(Thread.java:748) ~[?:1.8.0_131]
>
> The version "1573546159565176832" does not exist. It looks a bit like the
> update was first creating a new value and then checks against it.
>
> regards,
> Hendrik
>
>
> On 21.07.2017 18:21, Amrit Sarkar wrote:
>
>> Hendrik,
>>
>> Can you list down the error snippet so that we can refer the code where
>> exactly that is happening.
>>
>>
>> Amrit Sarkar
>> Search Engineer
>> Lucidworks, Inc.
>> 415-589-9269
>> www.lucidworks.com
>> Twitter http://twitter.com/lucidworks
>> LinkedIn: https://www.linkedin.com/in/sarkaramrit2
>>
>> On Fri, Jul 21, 2017 at 9:50 PM, Hendrik Haddorp <hendrik.haddorp@gmx.net
>> >
>> wrote:
>>
>> Hi,
>>>
>>> when I try to use an atomic update in conjunction with optimistic
>>> concurrency Solr sometimes complains that the version I passed in does
>>> not
>>> match. The version in my request however match to what is stored and what
>>> the exception states as the actual version does not exist in the
>>> collection
>>> at all. Strangely this does only happen sometimes but once it happens
>>> for a
>>> collection it seems to stay like that. Any idea why that might happen?
>>>
>>> I'm using Solr 6.3 in Cloud mode with SolrJ.
>>>
>>> regards,
>>> Hendrik
>>>
>>>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message