Solr
  1. Solr
  2. SOLR-6981

bin/solr should have a delete action to complement the create action

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.0, 6.0
    • Component/s: scripts and tools
    • Labels:
      None

      Description

      In SOLR-6952, we changed the create_collection logic to create a copy of a configset in ZooKeeper by default, i.e. if you do bin/solr create -c foo then then the server/solr/configsets/data_driven_schema_configs directory is uploaded to ZK as /configs/foo ... Since it is data driven, the managed schema starts to change as docs flow in ... good so far ... now the user decides to delete the foo collection and re-create it. The delete collection action leaves the /configs/foo directory in ZK and the create action in bin/solr does not overwrite existing files in ZooKeeper. So something very subtle happens, the previous data-driven changes are still in effect, which will be quite confusing for new users who think the delete action removed the configs.

      For now, I think the bin/solr script should handle this on the delete side by:

      1) checking to make sure the config is not being used by any other collection
      2) delete the /configs/foo after deleting the collection

      If the check for #1 fails, then the delete will proceed with a simple WARNING that the configs are shared and will not be deleted by this action.

      Looking ahead, we probably want to deal with this copying of configsets and then handling the deletes correctly in the collections API, i.e. right now, the smarts can live in the bin/solr script and SolrCLI but the long-term solution should be to move those smarts into the CREATE and DELETE actions of the Collections API. We also should think about making the concept of a "shared" configuration directory more explicit.

        Activity

        Hide
        ASF subversion and git services added a comment -

        Commit 1652345 from Timothy Potter in branch 'dev/trunk'
        [ https://svn.apache.org/r1652345 ]

        SOLR-6981: add a delete action to the bin/solr script

        Show
        ASF subversion and git services added a comment - Commit 1652345 from Timothy Potter in branch 'dev/trunk' [ https://svn.apache.org/r1652345 ] SOLR-6981 : add a delete action to the bin/solr script
        Hide
        ASF subversion and git services added a comment -

        Commit 1652347 from Timothy Potter in branch 'dev/branches/branch_5x'
        [ https://svn.apache.org/r1652347 ]

        SOLR-6981: add a delete action to the bin/solr script

        Show
        ASF subversion and git services added a comment - Commit 1652347 from Timothy Potter in branch 'dev/branches/branch_5x' [ https://svn.apache.org/r1652347 ] SOLR-6981 : add a delete action to the bin/solr script
        Hide
        ASF subversion and git services added a comment -

        Commit 1652348 from Timothy Potter in branch 'dev/branches/lucene_solr_5_0'
        [ https://svn.apache.org/r1652348 ]

        SOLR-6981: add a delete action to the bin/solr script

        Show
        ASF subversion and git services added a comment - Commit 1652348 from Timothy Potter in branch 'dev/branches/lucene_solr_5_0' [ https://svn.apache.org/r1652348 ] SOLR-6981 : add a delete action to the bin/solr script
        Hide
        Anshum Gupta added a comment -

        Bulk close after 5.0 release.

        Show
        Anshum Gupta added a comment - Bulk close after 5.0 release.

          People

          • Assignee:
            Timothy Potter
            Reporter:
            Timothy Potter
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development