Solr
  1. Solr
  2. SOLR-5135

Deleting a collection should be extra aggressive in the face of failures.

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.5, 6.0
    • Component/s: SolrCloud
    • Labels:
      None

      Description

      Until Zk is the source of truth for the cluster, zk and local node states can get out of whack in certain situations - as a result, sometimes you cannot clean out all of the remnants of a collection to recreate it. For example, if the collection is listed in zk under /collections, but is not in clusterstate.json, you cannot remove or create the collection again due to a early exception in the collection removal chain.

      I think we should probably still return the error - but also delete as much as we can.

        Activity

        Hide
        Mark Miller added a comment -

        or create the collection again due

        Seems you can actually create it again - we check existence vs the clusterstate.json rather than the /collections node - we should still remove the remnants though.

        Show
        Mark Miller added a comment - or create the collection again due Seems you can actually create it again - we check existence vs the clusterstate.json rather than the /collections node - we should still remove the remnants though.
        Hide
        Mark Miller added a comment -

        Attached patch adds an attempt to remove the /collections zk node in a finally after trying to remove all of the cores.

        Show
        Mark Miller added a comment - Attached patch adds an attempt to remove the /collections zk node in a finally after trying to remove all of the cores.
        Hide
        ASF subversion and git services added a comment -

        Commit 1513864 from Mark Miller in branch 'dev/trunk'
        [ https://svn.apache.org/r1513864 ]

        SOLR-5135: Harden Collection API deletion of /collections/$collection ZooKeeper node

        Show
        ASF subversion and git services added a comment - Commit 1513864 from Mark Miller in branch 'dev/trunk' [ https://svn.apache.org/r1513864 ] SOLR-5135 : Harden Collection API deletion of /collections/$collection ZooKeeper node
        Hide
        ASF subversion and git services added a comment -

        Commit 1513866 from Mark Miller in branch 'dev/branches/branch_4x'
        [ https://svn.apache.org/r1513866 ]

        SOLR-5135: Harden Collection API deletion of /collections/$collection ZooKeeper node

        Show
        ASF subversion and git services added a comment - Commit 1513866 from Mark Miller in branch 'dev/branches/branch_4x' [ https://svn.apache.org/r1513866 ] SOLR-5135 : Harden Collection API deletion of /collections/$collection ZooKeeper node
        Hide
        Adrien Grand added a comment -

        4.5 release -> bulk close

        Show
        Adrien Grand added a comment - 4.5 release -> bulk close
        Hide
        Igor Belakovskiy added a comment -

        Is there any sort of a workaround for pre 4.5 versions--is there any manual way to clean up a partially deleted collection that is listed in zk under /collections, but is not in clusterstate.json?

        Show
        Igor Belakovskiy added a comment - Is there any sort of a workaround for pre 4.5 versions--is there any manual way to clean up a partially deleted collection that is listed in zk under /collections, but is not in clusterstate.json?
        Hide
        Mark Miller added a comment -

        Sure, just remove the /collection/

        {name}

        node manually. You can use the zk cmd line tools, the zkcli tool, or a graphical tool (I like the zk eclipse plugin).

        Show
        Mark Miller added a comment - Sure, just remove the /collection/ {name} node manually. You can use the zk cmd line tools, the zkcli tool, or a graphical tool (I like the zk eclipse plugin).
        Hide
        Igor Belakovskiy added a comment -

        Used the rmr command from the command line, worked like a charm. Thank you, Mark!

        Show
        Igor Belakovskiy added a comment - Used the rmr command from the command line, worked like a charm. Thank you, Mark!

          People

          • Assignee:
            Mark Miller
            Reporter:
            Mark Miller
          • Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development