Solr
  1. Solr
  2. SOLR-7988

LukeRequest on default path is broken with CloudSolrClient

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 5.3
    • Fix Version/s: 5.3.1, 5.4, 6.0
    • Component/s: SolrJ
    • Labels:
      None

      Description

      SOLR-7757 breaks the default access on the LukeRequestHandler (/admin/luke) with CloudSolrClient.

      See the following commit :

      https://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudSolrClient.java?r1=1694556&r2=1694555&pathrev=1694556

      The name of the collection is not added to the request URL and therefore we get a 404 error in the response.

      Defining the LukeRequestHandler with another path in the solrconfig is a workaround but it's quite annoying.

        Activity

        Hide
        Mark Miller added a comment -

        Best thing we can do to preserve this functionality is get a test in for it.

        Show
        Mark Miller added a comment - Best thing we can do to preserve this functionality is get a test in for it.
        Hide
        Noble Paul added a comment -

        Is this for solrcloud or standalone solr ?

        Show
        Noble Paul added a comment - Is this for solrcloud or standalone solr ?
        Hide
        Ludovic Boutros added a comment -

        I've only tested with SolrCloud currently in an IT case.

        Show
        Ludovic Boutros added a comment - I've only tested with SolrCloud currently in an IT case.
        Hide
        Mark Miller added a comment -

        CloudSolrClient does not work with standalone.

        Show
        Mark Miller added a comment - CloudSolrClient does not work with standalone.
        Hide
        Ludovic Boutros added a comment -

        Well, quite true

        The question I would have here is:

        Do you want to keep this handler and perhaps others, which need the collection name on the admin path ?

        If yes, I can imagine an exclusion in the CloudSolrClient
        if no, we just need to choose another path and register the handler(s) with this new path (but that would break a sort of compatibility...)

        Show
        Ludovic Boutros added a comment - Well, quite true The question I would have here is: Do you want to keep this handler and perhaps others, which need the collection name on the admin path ? If yes, I can imagine an exclusion in the CloudSolrClient if no, we just need to choose another path and register the handler(s) with this new path (but that would break a sort of compatibility...)
        Hide
        Mark Miller added a comment -

        Yeah, I don't think we want to move to a new path. We just want to fix the bug that was introduced via SOLR-7757.

        Show
        Mark Miller added a comment - Yeah, I don't think we want to move to a new path. We just want to fix the bug that was introduced via SOLR-7757 .
        Hide
        Noble Paul added a comment -

        yeah, this is a regression. Let's fix that and move on

        Show
        Noble Paul added a comment - yeah, this is a regression. Let's fix that and move on
        Hide
        Ludovic Boutros added a comment -

        Ok, I will create a patch with a test and a fix.

        What are the current default admin handlers which need the collection name ?

        Show
        Ludovic Boutros added a comment - Ok, I will create a patch with a test and a fix. What are the current default admin handlers which need the collection name ?
        Hide
        Noble Paul added a comment -

        I'm fixing it . Can you post your sample code . I can use it in the test case

        Show
        Noble Paul added a comment - I'm fixing it . Can you post your sample code . I can use it in the test case
        Hide
        Ludovic Boutros added a comment -

        I did not test this code but something like this should work:

        DefaultHandlerTest.java
        private void defaultHandlerTest() {
            String collectionName = "defaultHandlerCollection";
            createCollection(collectionName, controlClientCloud, 2, 2);
            waitForRecoveriesToFinish(collectionName, false);
            try (CloudSolrClient cloudClient = createCloudClient(collectionName)) {
        
              LukeRequest lukeRequest = new LukeRequest();
        
              try {
                lukeResponse = lukeRequest.process(cloudClient);
              } catch (Exception e) {
                fail("Cannot find default luke request handler");
              }
            }
          }
        
        Show
        Ludovic Boutros added a comment - I did not test this code but something like this should work: DefaultHandlerTest.java private void defaultHandlerTest() { String collectionName = "defaultHandlerCollection" ; createCollection(collectionName, controlClientCloud, 2, 2); waitForRecoveriesToFinish(collectionName, false ); try (CloudSolrClient cloudClient = createCloudClient(collectionName)) { LukeRequest lukeRequest = new LukeRequest(); try { lukeResponse = lukeRequest.process(cloudClient); } catch (Exception e) { fail( "Cannot find default luke request handler" ); } } }
        Hide
        Noble Paul added a comment -

        thanks

        Show
        Noble Paul added a comment - thanks
        Hide
        ASF subversion and git services added a comment -

        Commit 1700580 from Noble Paul in branch 'dev/trunk'
        [ https://svn.apache.org/r1700580 ]

        SOLR-7988: LukeRequest on default path is broken with CloudSolrClient

        Show
        ASF subversion and git services added a comment - Commit 1700580 from Noble Paul in branch 'dev/trunk' [ https://svn.apache.org/r1700580 ] SOLR-7988 : LukeRequest on default path is broken with CloudSolrClient
        Hide
        Ludovic Boutros added a comment -

        Thank you !

        Show
        Ludovic Boutros added a comment - Thank you !
        Hide
        ASF subversion and git services added a comment -

        Commit 1700593 from Noble Paul in branch 'dev/branches/branch_5x'
        [ https://svn.apache.org/r1700593 ]

        SOLR-7988: LukeRequest on default path is broken with CloudSolrClient

        Show
        ASF subversion and git services added a comment - Commit 1700593 from Noble Paul in branch 'dev/branches/branch_5x' [ https://svn.apache.org/r1700593 ] SOLR-7988 : LukeRequest on default path is broken with CloudSolrClient
        Hide
        ASF subversion and git services added a comment -

        Commit 1701981 from Noble Paul in branch 'dev/branches/lucene_solr_5_3'
        [ https://svn.apache.org/r1701981 ]

        SOLR-7988: SolrJ could not make requests to handlers with '/admin/' prefix

        Show
        ASF subversion and git services added a comment - Commit 1701981 from Noble Paul in branch 'dev/branches/lucene_solr_5_3' [ https://svn.apache.org/r1701981 ] SOLR-7988 : SolrJ could not make requests to handlers with '/admin/' prefix

          People

          • Assignee:
            Noble Paul
            Reporter:
            Ludovic Boutros
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development