SOLR-10734: Fix Multithreaded test/support for AtomicURP

This commit is contained in:
Shalin Shekhar Mangar 2018-03-27 15:04:18 +05:30
parent 160faaf594
commit 64c110c58d
3 changed files with 5 additions and 4 deletions

View File

@ -119,6 +119,8 @@ Other Changes
* SOLR-12118: Solr Ref-Guide can now use some ivy version props directly as attributes in content (hossman) * SOLR-12118: Solr Ref-Guide can now use some ivy version props directly as attributes in content (hossman)
* SOLR-10734: Multithreaded test/support for AtomicURP broken. (Ishan Chattopadhyaya, Noble Paul, Amrit Sarkar, shalin)
================== 7.3.0 ================== ================== 7.3.0 ==================
Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this release. Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this release.

View File

@ -173,7 +173,7 @@ public class AtomicUpdateProcessorFactory extends UpdateRequestProcessorFactory
} }
if (e.code() == ErrorCode.CONFLICT.code) { // version conflict if (e.code() == ErrorCode.CONFLICT.code) { // version conflict
log.warn("Atomic update failed due to " + e.getMessage() + log.warn("Atomic update failed due to " + e.getMessage() +
"Retrying with new version .... (" + attempts + ")"); " Retrying with new version .... (" + attempts + ")");
Long lastVersion = vinfo.lookupVersion(cmd.getIndexedId()); Long lastVersion = vinfo.lookupVersion(cmd.getIndexedId());
if (lastVersion != null) { if (lastVersion != null) {
cmd.solrDoc.setField(VERSION, lastVersion); cmd.solrDoc.setField(VERSION, lastVersion);

View File

@ -198,7 +198,6 @@ public class AtomicUpdateProcessorFactoryTest extends SolrTestCaseJ4 {
} }
@BadApple(bugUrl = "https://issues.apache.org/jira/browse/SOLR-10734")
public void testMultipleThreads() throws Exception { public void testMultipleThreads() throws Exception {
clearIndex(); clearIndex();
String[] strings = new String[5]; String[] strings = new String[5];
@ -227,7 +226,7 @@ public class AtomicUpdateProcessorFactoryTest extends SolrTestCaseJ4 {
)); ));
cmd.solrDoc = new SolrInputDocument(); cmd.solrDoc = new SolrInputDocument();
cmd.solrDoc.addField("id", 10); //hardcoded id=2 cmd.solrDoc.addField("id", 10); //hardcoded id=10
cmd.solrDoc.addField("cat", strings[index]); cmd.solrDoc.addField("cat", strings[index]);
cmd.solrDoc.addField("int_i", index); cmd.solrDoc.addField("int_i", index);
@ -258,7 +257,7 @@ public class AtomicUpdateProcessorFactoryTest extends SolrTestCaseJ4 {
} }
assertQ("Check the total number of docs", assertQ("Check the total number of docs",
req("q", "cat:" + queryString.toString()) req("q", "cat:(" + queryString.toString() + ")")
, "//result[@numFound=1]"); , "//result[@numFound=1]");
assertQ("Check the total number of docs", assertQ("Check the total number of docs",