Solr
  1. Solr
  2. SOLR-5306

can not create collection when have over one config

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 4.5
    • Fix Version/s: 4.5.1, 4.6, Trunk
    • Component/s: clients - java
    • Labels:
      None
    • Environment:

      win7 jdk 7

      Description

      I have uploaded zookeeper two config: patent and applicant. I can not create collection:http://localhost:8080/solr/admin/collections?action=CREATE&name=patent_main_1&numShards=1&collection.configName=patent.show errors:patent_main_1_shard1_replica1: org.apache.solr.common.cloud.ZooKeeperException:org.apache.solr.common.cloud.ZooKeeperException: Could not find configName for collection patent_main_1 found:[applicant, patent]. In solr 4.4 I can create sucessfully.

      1. SOLR-5306.patch
        20 kB
        Mark Miller

        Issue Links

          Activity

          Liang Tianyu created issue -
          Hide
          Erick Erickson added a comment -

          Please raise issues on the Solr user's list first to be certain you've really found a problem and are not simply making an error. In this case, the error message is telling you that the only configurations you have are "applicant" and "patent". You have specified a name of "patent.show" via configName.

          Show
          Erick Erickson added a comment - Please raise issues on the Solr user's list first to be certain you've really found a problem and are not simply making an error. In this case, the error message is telling you that the only configurations you have are "applicant" and "patent". You have specified a name of "patent.show" via configName.
          Erick Erickson made changes -
          Field Original Value New Value
          Status Open [ 1 ] Resolved [ 5 ]
          Resolution Not A Problem [ 8 ]
          Hide
          Liang Tianyu added a comment -

          I am sorry.I am a developer in china,bad english.
          The correct url is::http://localhost:8080/solr/admin/collections?action=CREATE&name=patent_main_1&numShards=1&collection.configName=patent.
          I have readed and debuged solr 4.5 source code,I find 'setParams(SolrParams params)' never used in 'CloudDescriptor' class.Although I specify collection.confgName parameters, in fact, did not work.Can you help me,thanks!

          Show
          Liang Tianyu added a comment - I am sorry.I am a developer in china,bad english. The correct url is:: http://localhost:8080/solr/admin/collections?action=CREATE&name=patent_main_1&numShards=1&collection.configName=patent . I have readed and debuged solr 4.5 source code,I find 'setParams(SolrParams params)' never used in 'CloudDescriptor' class.Although I specify collection.confgName parameters, in fact, did not work.Can you help me,thanks!
          Hide
          Liang Tianyu added a comment -

          Please see https://issues.apache.org/jira/browse/SOLR-5307,the same question.
          The correct url is::http://localhost:8080/solr/admin/collections?action=CREATE&name=patent_main_1&numShards=1&collection.configName=patent.
          I have readed and debuged solr 4.5 source code,I find 'setParams(SolrParams params)' never used in 'CloudDescriptor' class.Although I specify collection.confgName parameters, in fact, did not work.

          Show
          Liang Tianyu added a comment - Please see https://issues.apache.org/jira/browse/SOLR-5307,the same question. The correct url is:: http://localhost:8080/solr/admin/collections?action=CREATE&name=patent_main_1&numShards=1&collection.configName=patent . I have readed and debuged solr 4.5 source code,I find 'setParams(SolrParams params)' never used in 'CloudDescriptor' class.Although I specify collection.confgName parameters, in fact, did not work.
          Liang Tianyu made changes -
          Resolution Not A Problem [ 8 ]
          Status Resolved [ 5 ] Reopened [ 4 ]
          Hide
          Liang Tianyu added a comment -

          I add some code at line 453 in class CoreAdminHandler:
          String opts = params.get(CoreAdminParams.CONFIG);
          CloudDescriptor cd = dcore.getCloudDescriptor();

          if (cd != null)

          { cd.setParams(req.getParams()); opts = params.get(CoreAdminParams.COLLECTION); if (opts != null) cd.setCollectionName(opts); opts = params.get(CoreAdminParams.SHARD); if (opts != null) cd.setShardId(opts); opts = params.get(CoreAdminParams.SHARD_RANGE); if (opts != null) cd.setShardRange(opts); opts = params.get(CoreAdminParams.SHARD_STATE); if (opts != null) cd.setShardState(opts); opts = params.get(CoreAdminParams.ROLES); if (opts != null) cd.setRoles(opts); opts = params.get(CoreAdminParams.CORE_NODE_NAME); if (opts != null) cd.setCoreNodeName(opts); Integer numShards = params.getInt(ZkStateReader.NUM_SHARDS_PROP); if (numShards != null) cd.setNumShards(numShards); }

          test passed.

          Show
          Liang Tianyu added a comment - I add some code at line 453 in class CoreAdminHandler: String opts = params.get(CoreAdminParams.CONFIG); CloudDescriptor cd = dcore.getCloudDescriptor(); if (cd != null) { cd.setParams(req.getParams()); opts = params.get(CoreAdminParams.COLLECTION); if (opts != null) cd.setCollectionName(opts); opts = params.get(CoreAdminParams.SHARD); if (opts != null) cd.setShardId(opts); opts = params.get(CoreAdminParams.SHARD_RANGE); if (opts != null) cd.setShardRange(opts); opts = params.get(CoreAdminParams.SHARD_STATE); if (opts != null) cd.setShardState(opts); opts = params.get(CoreAdminParams.ROLES); if (opts != null) cd.setRoles(opts); opts = params.get(CoreAdminParams.CORE_NODE_NAME); if (opts != null) cd.setCoreNodeName(opts); Integer numShards = params.getInt(ZkStateReader.NUM_SHARDS_PROP); if (numShards != null) cd.setNumShards(numShards); } test passed.
          Erick Erickson made changes -
          Link This issue relates to SOLR-5307 [ SOLR-5307 ]
          Mark Miller made changes -
          Assignee Mark Miller [ markrmiller@gmail.com ]
          Mark Miller made changes -
          Attachment SOLR-5306.patch [ 12607622 ]
          Mark Miller made changes -
          Link This issue relates to SOLR-5307 [ SOLR-5307 ]
          Mark Miller made changes -
          Link This issue is duplicated by SOLR-5307 [ SOLR-5307 ]
          Mark Miller made changes -
          Fix Version/s 4.5.1 [ 12325264 ]
          Fix Version/s 4.6 [ 12325000 ]
          Fix Version/s 5.0 [ 12321664 ]
          Hide
          ASF subversion and git services added a comment -

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

          SOLR-5306: Extra collection creation parameters like collection.configName are not being respected.

          Show
          ASF subversion and git services added a comment - Commit 1530772 from Mark Miller in branch 'dev/trunk' [ https://svn.apache.org/r1530772 ] SOLR-5306 : Extra collection creation parameters like collection.configName are not being respected.
          Hide
          ASF subversion and git services added a comment -

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

          SOLR-5306: Extra collection creation parameters like collection.configName are not being respected.

          Show
          ASF subversion and git services added a comment - Commit 1530773 from Mark Miller in branch 'dev/branches/branch_4x' [ https://svn.apache.org/r1530773 ] SOLR-5306 : Extra collection creation parameters like collection.configName are not being respected.
          Hide
          Mark Miller added a comment -

          Looks like SOLR-4914 is also the one that introduced this.

          Show
          Mark Miller added a comment - Looks like SOLR-4914 is also the one that introduced this.
          Hide
          ASF subversion and git services added a comment -

          Commit 1531174 from Mark Miller in branch 'dev/branches/lucene_solr_4_5'
          [ https://svn.apache.org/r1531174 ]

          SOLR-5306: Extra collection creation parameters like collection.configName are not being respected.

          Show
          ASF subversion and git services added a comment - Commit 1531174 from Mark Miller in branch 'dev/branches/lucene_solr_4_5' [ https://svn.apache.org/r1531174 ] SOLR-5306 : Extra collection creation parameters like collection.configName are not being respected.
          Hide
          Mark Miller added a comment -

          Thanks Liang and Nathan!

          Show
          Mark Miller added a comment - Thanks Liang and Nathan!
          Mark Miller made changes -
          Status Reopened [ 4 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open Resolved Resolved
          4h 50m 1 Erick Erickson 06/Oct/13 13:42
          Resolved Resolved Reopened Reopened
          10h 24m 1 Liang Tianyu 07/Oct/13 00:06
          Reopened Reopened Resolved Resolved
          4d 3h 26m 1 Mark Miller 11/Oct/13 03:33

            People

            • Assignee:
              Mark Miller
              Reporter:
              Liang Tianyu
            • Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development