Solr
  1. Solr
  2. SOLR-5739

SPLITSHARD creates shards "...Ignoring commit while not ACTIVE"

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: 4.6.1
    • Fix Version/s: 4.7, 6.0
    • Component/s: SolrCloud
    • Labels:
      None
    • Environment:

      Windows 7 64 bit, Debian 3.11.1

      Description

      I've tried to use the SPLITSHARD command from the Solr collection-Api.
      A JUnit test successfully runs before the split, but fails after splitting the shard, stopping and restarting Solr. It won't fail if Solr isn't restarted after splitting.

      I found some entries in files "solr.log" and "core.properties" which may give hints.

      After split:

      org.apache.solr.update.UpdateLog; Starting to buffer updates. FSUpdateLog{state=ACTIVE, tlog=null
      is logged for both newly created shards in "solr.log"

      "clusterstate.json" from Solr Cloud admin page shows:
      shard1 state: inactive (replica: active)
      shard1_0 state: active parent shard1 (replica active)
      shard1_1 state: active parent shard1 (replica active)

      Both "core.properties" files of the newly created shards have
      shardState=construction and shardParent=shard1
      entries.
      The "core.properties" file of the parent shard is not changed.

      When restarting Solr

      and running the JUnit again these entries are logged:
      org.apache.solr.update.processor.DistributedUpdateProcessor; Ignoring commit while not ACTIVE - state: BUFFERING replay:0
      in "solr.log"

      I mainly I followed the steps of this tutorial http://architects.dzone.com/articles/solr-43-shard-splitting-quick.

      1. (install solr-4.6.1)
      2. create a small cluster:
        java -Dbootstrap_confdir=./solr/portalse/conf -Dcollection.configName=portalse -DzkRun -DnumShards=1 -DmaxShardsPerNode=2 -DreplicationFactor=1 -jar start.jar
      3. Run the unit test (after termination only one document exists).
      4. Split the only shard:
        curl 'http://localhost:8983/solr/admin/collections?action=SPLITSHARD&collection=portalse&shard=shard1'
        shard "collection1_shard1_0_replica1" created (1 document)
        shard "collection1_shard1_1_replica1" created (0 documents)
      5. commit index:
        curl 'http://localhost:8983/solr/portalse/update' --data-binary '<commit/>' -H 'Content-type:application/xml'
      6. stop Solr by pressing Ctl-C.
      7. restart Solr:
        java -DzkRun -jar start.jar
      8. Run the unit test from step 2 again.
      1. SOLR-5739.patch
        4 kB
        Shalin Shekhar Mangar
      2. SOLR-5739-fix.patch
        7 kB
        Shalin Shekhar Mangar

        Activity

        Hide
        Shalin Shekhar Mangar added a comment - - edited

        Thanks Günther. I can reproduce this issue. The shardState, shardRange and shardParent params are supposed to be used only once and then discarded. They should not be stored in core.properties.

        Show
        Shalin Shekhar Mangar added a comment - - edited Thanks Günther. I can reproduce this issue. The shardState, shardRange and shardParent params are supposed to be used only once and then discarded. They should not be stored in core.properties.
        Hide
        Shalin Shekhar Mangar added a comment -

        Patch uses createShard overseer command to create the shard removing the need to pass shard state, range and parent to the core admin create command.

        Show
        Shalin Shekhar Mangar added a comment - Patch uses createShard overseer command to create the shard removing the need to pass shard state, range and parent to the core admin create command.
        Hide
        ASF subversion and git services added a comment -

        Commit 1569072 from shalin@apache.org in branch 'dev/trunk'
        [ https://svn.apache.org/r1569072 ]

        SOLR-5739: Sub-shards created by shard splitting have their update log set to buffering mode on restarts

        Show
        ASF subversion and git services added a comment - Commit 1569072 from shalin@apache.org in branch 'dev/trunk' [ https://svn.apache.org/r1569072 ] SOLR-5739 : Sub-shards created by shard splitting have their update log set to buffering mode on restarts
        Hide
        ASF subversion and git services added a comment -

        Commit 1569073 from shalin@apache.org in branch 'dev/branches/branch_4x'
        [ https://svn.apache.org/r1569073 ]

        SOLR-5739: Sub-shards created by shard splitting have their update log set to buffering mode on restarts

        Show
        ASF subversion and git services added a comment - Commit 1569073 from shalin@apache.org in branch 'dev/branches/branch_4x' [ https://svn.apache.org/r1569073 ] SOLR-5739 : Sub-shards created by shard splitting have their update log set to buffering mode on restarts
        Hide
        Shalin Shekhar Mangar added a comment -

        Thanks Günther!

        Show
        Shalin Shekhar Mangar added a comment - Thanks Günther!
        Hide
        Shalin Shekhar Mangar added a comment -

        Argh, I didn't actually remove the state, range and parent params from the core admin call.

        Show
        Shalin Shekhar Mangar added a comment - Argh, I didn't actually remove the state, range and parent params from the core admin call.
        Hide
        Shalin Shekhar Mangar added a comment -

        Removes the shardRange, shardParent and shardState params from CloudDescriptor and related access methods.

        Show
        Shalin Shekhar Mangar added a comment - Removes the shardRange, shardParent and shardState params from CloudDescriptor and related access methods.
        Hide
        ASF subversion and git services added a comment -

        Commit 1569154 from shalin@apache.org in branch 'dev/trunk'
        [ https://svn.apache.org/r1569154 ]

        SOLR-5739: Removed shard state, range and parent from CoreAdmin calls and CoreDescriptor

        Show
        ASF subversion and git services added a comment - Commit 1569154 from shalin@apache.org in branch 'dev/trunk' [ https://svn.apache.org/r1569154 ] SOLR-5739 : Removed shard state, range and parent from CoreAdmin calls and CoreDescriptor
        Hide
        ASF subversion and git services added a comment -

        Commit 1569155 from shalin@apache.org in branch 'dev/branches/branch_4x'
        [ https://svn.apache.org/r1569155 ]

        SOLR-5739: Removed shard state, range and parent from CoreAdmin calls and CoreDescriptor

        Show
        ASF subversion and git services added a comment - Commit 1569155 from shalin@apache.org in branch 'dev/branches/branch_4x' [ https://svn.apache.org/r1569155 ] SOLR-5739 : Removed shard state, range and parent from CoreAdmin calls and CoreDescriptor

          People

          • Assignee:
            Shalin Shekhar Mangar
            Reporter:
            Günther Ruck
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development