Solr
  1. Solr
  2. SOLR-6206

The migrate collection API fails on retry because temp collection already exists

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 4.8.1, 4.9
    • Fix Version/s: 4.10, 6.0
    • Component/s: SolrCloud
    • Labels:
      None

      Description

      The migrate collection API fails on retry because temp collection already exists. We should attempt to re-use a temp collection after cleaning it up instead of failing the command.

      1. SOLR-6206.patch
        4 kB
        Shalin Shekhar Mangar

        Activity

        Hide
        Shalin Shekhar Mangar added a comment -

        Patch which re-uses an existing temp collection after deleting all documents from it.

        Show
        Shalin Shekhar Mangar added a comment - Patch which re-uses an existing temp collection after deleting all documents from it.
        Hide
        Shalin Shekhar Mangar added a comment -

        Sorry, the changes in this patch were not required because we were already deleting the temporary collection at the start of the migrateKey method. We only need to do the following:

               try {
                 deleteCollection(new ZkNodeProps(props), results);
        +        clusterState = zkStateReader.getClusterState();
               } catch (Exception e) {
                 log.warn("Unable to clean up existing temporary collection: " + tempSourceCollectionName, e);
               }
        

        We just need to refresh the cluster state object after deleting the collection for re-tries to work. I'll commit this change.

        Show
        Shalin Shekhar Mangar added a comment - Sorry, the changes in this patch were not required because we were already deleting the temporary collection at the start of the migrateKey method. We only need to do the following: try { deleteCollection( new ZkNodeProps(props), results); + clusterState = zkStateReader.getClusterState(); } catch (Exception e) { log.warn( "Unable to clean up existing temporary collection: " + tempSourceCollectionName, e); } We just need to refresh the cluster state object after deleting the collection for re-tries to work. I'll commit this change.
        Hide
        ASF subversion and git services added a comment -

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

        SOLR-6206: The migrate collection API fails on retry if temp collection already exists

        Show
        ASF subversion and git services added a comment - Commit 1605771 from shalin@apache.org in branch 'dev/trunk' [ https://svn.apache.org/r1605771 ] SOLR-6206 : The migrate collection API fails on retry if temp collection already exists
        Hide
        ASF subversion and git services added a comment -

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

        SOLR-6206: The migrate collection API fails on retry if temp collection already exists

        Show
        ASF subversion and git services added a comment - Commit 1605773 from shalin@apache.org in branch 'dev/branches/branch_4x' [ https://svn.apache.org/r1605773 ] SOLR-6206 : The migrate collection API fails on retry if temp collection already exists

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development