Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-4040

SolrCloud deleteByQuery requires multiple commits

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 4.0
    • 4.0
    • update
    • OSX

    Description

      I am using embedded zookeeper and my cloud layout is show below (all actions are done on the "patents' collection only).

      First commit/delete works for a single shard only, dropping query results by about a third. Second commit/delete drops query results to zero.

      http://127.0.0.1:8893/solr/patents/update?commit=true&stream.body=<delete><query>dogs</query></delete>
      http://localhost:8893/solr/patents/select?q=dogs&rows=0 (results drop by a third)
      http://127.0.0.1:8893/solr/patents/update?commit=true&stream.body=<delete><query>dogs</query></delete>
      http://localhost:8893/solr/patents/select?q=dogs&rows=0 (results drop to zero)

      Note that a delete without a commit followed by a commit drops query results to zero, as it should:

      http://127.0.0.1:8893/solr/patents/update/?stream.body=<delete><query>dogs</query></delete>
      http://localhost:8893/solr/patents/select?q=dogs&rows=0 (full count as no commit yet)
      http://127.0.0.1:8893/solr/patents/update/?commit=true
      http://localhost:8893/solr/patents/select?q=dogs&rows=0 (results drop to zero)

      One workaround (produces zero hits in one shot):

      http://127.0.0.1:8893/solr/patents/update?commit=true&stream.body=<outer><delete><query>sun</query></delete><commit/></outer>

      The workaround I am using for now (produces zero hits in one shot):

      http://127.0.0.1:8893/solr/patents/update?stream.body=<outer><delete><query>knee</query></delete><commit/><commit/></outer>

      {
        "otherdocs":{"slice0":{"replicas":{"Darins-MacBook-Pro.local:8893_solr_otherdocs_shard0":{
                "shard":"slice0",
                "roles":null,
                "state":"active",
                "core":"otherdocs_shard0",
                "collection":"otherdocs",
                "node_name":"Darins-MacBook-Pro.local:8893_solr",
                "base_url":"http://Darins-MacBook-Pro.local:8893/solr",
                "leader":"true"}}}},
        "patents":{
          "slice0":{"replicas":{"Darins-MacBook-Pro.local:8893_solr_patents_shard0":{
                "shard":"slice0",
                "roles":null,
                "state":"active",
                "core":"patents_shard0",
                "collection":"patents",
                "node_name":"Darins-MacBook-Pro.local:8893_solr",
                "base_url":"http://Darins-MacBook-Pro.local:8893/solr",
                "leader":"true"}}},
          "slice1":{"replicas":{"Darins-MacBook-Pro.local:8893_solr_patents_shard1":{
                "shard":"slice1",
                "roles":null,
                "state":"active",
                "core":"patents_shard1",
                "collection":"patents",
                "node_name":"Darins-MacBook-Pro.local:8893_solr",
                "base_url":"http://Darins-MacBook-Pro.local:8893/solr",
                "leader":"true"}}},
          "slice2":{"replicas":{"Darins-MacBook-Pro.local:8893_solr_patents_shard2":{
                "shard":"slice2",
                "roles":null,
                "state":"active",
                "core":"patents_shard2",
                "collection":"patents",
                "node_name":"Darins-MacBook-Pro.local:8893_solr",
                "base_url":"http://Darins-MacBook-Pro.local:8893/solr",
                "leader":"true"}}}}}
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            dplutcho Darin Plutchok
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated: