lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Amrit Sarkar (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (SOLR-10734) Multithreaded test/support for AtomicURP broken
Date Fri, 04 Aug 2017 04:47:00 GMT

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

Amrit Sarkar updated SOLR-10734:
--------------------------------
    Attachment: testMaster_2500
                testResults7_10
                testResultsMaster_10
                SOLR-10734.patch

I ran local beasts on system for master: 10 and 2500 rounds and branch_7x: 100 for the patch
uploaded recently in JIRA and it ran successfully. I am attaching the beast results too.

Changes done as explained above:
{code}
  // there is no gurantee of all the threads getting executed, even if one passes, concurrency
works.
  public void testMultipleThreads() throws Exception {
    clearIndex();
    String[] strings = new String[5];
    for (int i=0; i<5; i++) {
      strings[i] = generateRandomString();
    }

    List<Thread> threads = new ArrayList<>(100);
    int finalCount = 0; //int_i

    AtomicUpdateProcessorFactory factory = new AtomicUpdateProcessorFactory();
    factory.inform(h.getCore());

    for (int i = 0; i < 10; i++) {
      int index = random().nextInt(5);
      Thread t = new Thread() {
        @Override
        public void run() {
          AddUpdateCommand cmd = new AddUpdateCommand(new LocalSolrQueryRequest(h.getCore(),
              new ModifiableSolrParams()
                  .add("processor", "atomic")
                  .add("atomic.cat", "add")
                  .add("atomic.int_i", "inc")
                  .add("commit","true")

          ));

          cmd.solrDoc = new SolrInputDocument();
          cmd.solrDoc.addField("id", 10); //hardcoded id=2
          cmd.solrDoc.addField("cat", strings[index]);
          cmd.solrDoc.addField("int_i", index);

          try {
            factory.getInstance(cmd.getReq(), new SolrQueryResponse(),
                new DistributedUpdateProcessor(cmd.getReq(), new SolrQueryResponse(),
                    new RunUpdateProcessor(cmd.getReq(), null))).processAdd(cmd);
          } catch (IOException e) {
          }
        }
      };
      threads.add(t);
      t.start();
      finalCount += index; //int_i
    }

    for (Thread thread: threads) thread.join();

    assertU(commit());

    assertQ("Check the total number of docs",
        req("q", "id:10"), "//result[@numFound=1]");


    StringJoiner queryString = new StringJoiner(" OR ");
    for(String string: strings) {
      queryString.add(string);
    }

    assertQ("Check the total number of docs",
        req("q", "cat:(" + queryString.toString()+")")
        , "//result[@numFound=1]");

    assertQ("Check the total number of docs",
        req("q", "int_i:[* TO " + finalCount+"]")
        , "//result[@numFound=1]");

  }
{code}

significant changes:

cat:(A OR B OR C OR D) // proper parenthesized OR seperated query terms
int_i:[* to max_possible_sum] // range query for int_i, practically 0 to max_possible_sum

{code}
    StringJoiner queryString = new StringJoiner(" OR ");
    for(String string: strings) {
      queryString.add(string);
    }
    assertQ("Check the total number of docs",
        req("q", "cat:(" + queryString.toString()+")")
        , "//result[@numFound=1]");
    assertQ("Check the total number of docs",
        req("q", "int_i:[* TO " + finalCount+"]")
        , "//result[@numFound=1]");
{code}

the thought process for the above is atleast one of the threads should execute for multiple
seeds and multiple test configurations, heavy or light. This is the best I got, please let
me know if anything else can be done in this regard. I understand we are approaching 7.0 release
and we have this fixed in later version.

> Multithreaded test/support for AtomicURP broken
> -----------------------------------------------
>
>                 Key: SOLR-10734
>                 URL: https://issues.apache.org/jira/browse/SOLR-10734
>             Project: Solr
>          Issue Type: Bug
>      Security Level: Public(Default Security Level. Issues are Public) 
>            Reporter: Ishan Chattopadhyaya
>            Assignee: Noble Paul
>             Fix For: master (8.0), 7.1
>
>         Attachments: log-snippet, Screen Shot 2017-05-31 at 4.50.23 PM.png, SOLR-10734.patch,
SOLR-10734.patch, SOLR-10734.patch, testMaster_2500, testResults7_10, testResultsMaster_10
>
>
> The multithreaded test doesn't actually start the threads, but only invokes the run directly.
The join afterwards doesn't do anything, hence.
> {code}
> diff --git a/solr/core/src/test/org/apache/solr/update/processor/AtomicUpdateProcessorFactoryTest.java
b/solr/core/src/test/org/apache/solr/update/processor/AtomicUpdateProcessorFactoryTest.java
> index f3f833d..10b7770 100644
> --- a/solr/core/src/test/org/apache/solr/update/processor/AtomicUpdateProcessorFactoryTest.java
> +++ b/solr/core/src/test/org/apache/solr/update/processor/AtomicUpdateProcessorFactoryTest.java
> @@ -238,7 +238,7 @@ public class AtomicUpdateProcessorFactoryTest extends SolrTestCaseJ4
{
>            }
>          }
>        };
> -      t.run();
> +      t.run(); // red flag, shouldn't this be t.start?
>        threads.add(t);
>        finalCount += index; //int_i
>      }
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

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


Mime
View raw message