Solr
  1. Solr
  2. SOLR-4071

CollectionsHandler.handleCreateAction() doesn't validate parameter count and type

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 4.0-BETA, 4.0
    • Fix Version/s: 4.1, 6.0
    • Component/s: SolrCloud
    • Labels:
      None

      Description

      CollectionsHandler.handleCreateAction() doesn't validate parameter count and type. numShards's type doesn't checked and parameter count maybe less than required

        Issue Links

          Activity

          Hide
          Po Rui added a comment - - edited

          CollectionHandler validate parameter count and type
          OverseerCollectionProcessor validate existent collection name and nonexistent config path

          Show
          Po Rui added a comment - - edited CollectionHandler validate parameter count and type OverseerCollectionProcessor validate existent collection name and nonexistent config path
          Hide
          Mark Miller added a comment -

          This is likely a general issue with most of the 'admin' type apis - something we should improve though.

          Show
          Mark Miller added a comment - This is likely a general issue with most of the 'admin' type apis - something we should improve though.
          Hide
          Po Rui added a comment -

          yes. the null object got by SolrQueryRequest.getParams().get() will write into ZkNodeProps as a String "null" in Handler. e.g. request:http://127.0.0.1:8983/solr/admin/collections?action=CREATE&name=collection2&numShards=3&numReplicas=2. this request miss parameter 'collection.configName'. but the finally message offer to distributed queue(/overseer/queque) like

          {…… name : collection2; numShards : 3; collection.configName : null; …… }

          the String 'null' become the default value. all other args in any message maybe potentially assigned to value "null"

          Show
          Po Rui added a comment - yes. the null object got by SolrQueryRequest.getParams().get() will write into ZkNodeProps as a String "null" in Handler. e.g. request: http://127.0.0.1:8983/solr/admin/collections?action=CREATE&name=collection2&numShards=3&numReplicas=2 . this request miss parameter 'collection.configName'. but the finally message offer to distributed queue(/overseer/queque) like {…… name : collection2; numShards : 3; collection.configName : null; …… } the String 'null' become the default value. all other args in any message maybe potentially assigned to value "null"
          Hide
          Mark Miller added a comment -

          I'll get to this soon Po!

          Show
          Mark Miller added a comment - I'll get to this soon Po!
          Hide
          Commit Tag Bot added a comment -

          [trunk commit] Mark Robert Miller
          http://svn.apache.org/viewvc?view=revision&revision=1419952

          SOLR-4071: Validate that name is pass to Collections API create, and behave the same way as on startup when collection.configName is not explicitly passed.

          Show
          Commit Tag Bot added a comment - [trunk commit] Mark Robert Miller http://svn.apache.org/viewvc?view=revision&revision=1419952 SOLR-4071 : Validate that name is pass to Collections API create, and behave the same way as on startup when collection.configName is not explicitly passed.
          Hide
          Mark Miller added a comment -

          Thanks Po! I started validating for name. Technically, many of the other attributes should not currently be required, so I address the issue your brought up about adding a null valued property.

          Show
          Mark Miller added a comment - Thanks Po! I started validating for name. Technically, many of the other attributes should not currently be required, so I address the issue your brought up about adding a null valued property.
          Hide
          Commit Tag Bot added a comment -

          [branch_4x commit] Mark Robert Miller
          http://svn.apache.org/viewvc?view=revision&revision=1419953

          SOLR-4071: Validate that name is pass to Collections API create, and behave the same way as on startup when collection.configName is not explicitly passed.

          Show
          Commit Tag Bot added a comment - [branch_4x commit] Mark Robert Miller http://svn.apache.org/viewvc?view=revision&revision=1419953 SOLR-4071 : Validate that name is pass to Collections API create, and behave the same way as on startup when collection.configName is not explicitly passed.

            People

            • Assignee:
              Mark Miller
              Reporter:
              Po Rui
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development