Solr
  1. Solr
  2. SOLR-5399

Improve DebugComponent for distributed requests

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 6.0
    • Fix Version/s: 4.7, 6.0
    • Component/s: None
    • Labels:
      None

      Description

      I'm working on extending the DebugComponent for adding some useful information to be able to track distributed requests better. I'm adding two different things, first, the request can generate a "request ID" that will be printed in the logs for the main query and all the different internal requests to the different shards. This should make it easier to find the different parts of a single user request in the logs. It would also add the "purpose" of each internal request to the logs, like: RequestPurpose=GET_FIELDS,GET_DEBUG or RequestPurpose=GET_TOP_IDS.

      Also, I'm adding a "track" section to the debug info where to add information about the different phases of the distributed request (right now, I'm only including QTime, but could eventually include more information) like:

      <lst name="debug">
          <lst name="track">
              <lst name="EXECUTE_QUERY">
                  <str name="localhost:8985/solr">QTime: 10</str>
                  <str name="localhost:8984/solr">QTime: 25</str>
              </lst>
              <lst name="GET_FIELDS">
                  <str name="localhost:8985/solr">QTime: 1</str>
              </lst>
          </lst>
      </lst>
      

      To get this, debugQuery must be set to true, or debug must include "debug=track". This information is only added to distributed requests. I would like to get feedback on this.

      1. SOLR-5399_windows_fix.patch
        1 kB
        Tomás Fernández Löbbe
      2. SOLR-5399.patch
        32 kB
        Tomás Fernández Löbbe
      3. SOLR-5399.patch
        31 kB
        Tomás Fernández Löbbe
      4. SOLR-5399.patch
        21 kB
        Tomás Fernández Löbbe

        Issue Links

          Activity

          Hide
          Tomás Fernández Löbbe added a comment -

          Here is an raw patch with the idea. It still doesn't have any unit tests and I haven't tested it much with SolrCloud

          Show
          Tomás Fernández Löbbe added a comment - Here is an raw patch with the idea. It still doesn't have any unit tests and I haven't tested it much with SolrCloud
          Hide
          Tomás Fernández Löbbe added a comment -

          Added some unit tests. Also, I'm including for now the complete shard response in the track section.

          Show
          Tomás Fernández Löbbe added a comment - Added some unit tests. Also, I'm including for now the complete shard response in the track section.
          Hide
          Ryan Ernst added a comment -

          This looks very useful for debugging distributed requests!

          A couple minor thoughts on the patch:

          • It looks like there is a typo "tack" vs track, in DebugComponentTest.
          • In testModifyRequestTrack() and testPrepare(), it would be nice to add a loop so a couple variations can be tested in a single test run (just less reliance on jenkins coming up with seeds that will hit possible bugs).
          • The REQUEST_PURPOSE parameter name is in CamelCase, but it seems like the other request parameters are lowercase. Maybe make it match stylistically?

          +1 in general though.

          Show
          Ryan Ernst added a comment - This looks very useful for debugging distributed requests! A couple minor thoughts on the patch: It looks like there is a typo "tack" vs track, in DebugComponentTest. In testModifyRequestTrack() and testPrepare(), it would be nice to add a loop so a couple variations can be tested in a single test run (just less reliance on jenkins coming up with seeds that will hit possible bugs). The REQUEST_PURPOSE parameter name is in CamelCase, but it seems like the other request parameters are lowercase. Maybe make it match stylistically? +1 in general though.
          Hide
          Tomás Fernández Löbbe added a comment -

          Thanks Ryan. I added your suggestions. I changed RequestPurpose to requestPurpose, as other parameters we have.

          Show
          Tomás Fernández Löbbe added a comment - Thanks Ryan. I added your suggestions. I changed RequestPurpose to requestPurpose, as other parameters we have.
          Hide
          ASF subversion and git services added a comment -

          Commit 1541774 from Ryan Ernst in branch 'dev/trunk'
          [ https://svn.apache.org/r1541774 ]

          SOLR-5399: Add distributed request tracking information to DebugComponent

          Show
          ASF subversion and git services added a comment - Commit 1541774 from Ryan Ernst in branch 'dev/trunk' [ https://svn.apache.org/r1541774 ] SOLR-5399 : Add distributed request tracking information to DebugComponent
          Hide
          ASF subversion and git services added a comment -

          Commit 1541809 from Ryan Ernst in branch 'dev/branches/branch_4x'
          [ https://svn.apache.org/r1541809 ]

          SOLR-5399: Add distributed request tracking information to DebugComponent

          Show
          ASF subversion and git services added a comment - Commit 1541809 from Ryan Ernst in branch 'dev/branches/branch_4x' [ https://svn.apache.org/r1541809 ] SOLR-5399 : Add distributed request tracking information to DebugComponent
          Hide
          Ryan Ernst added a comment -

          Thanks Tomás!

          Show
          Ryan Ernst added a comment - Thanks Tomás!
          Show
          Shalin Shekhar Mangar added a comment - Looks like this is causing a transaction log leak on Windows. http://jenkins.thetaphi.de/job/Lucene-Solr-4.x-Windows/3386/ http://jenkins.thetaphi.de/job/Lucene-Solr-trunk-Windows/3463/
          Hide
          Tomás Fernández Löbbe added a comment -

          I think the problem is that the test tries to delete the solr home before stopping Jetty. I'm testing a fix now

          Show
          Tomás Fernández Löbbe added a comment - I think the problem is that the test tries to delete the solr home before stopping Jetty. I'm testing a fix now
          Hide
          Tomás Fernández Löbbe added a comment -

          Stopping Jetty before deleting the SolrHome directory fixes the problem in Windows

          Show
          Tomás Fernández Löbbe added a comment - Stopping Jetty before deleting the SolrHome directory fixes the problem in Windows
          Hide
          ASF subversion and git services added a comment -

          Commit 1542080 from Robert Muir in branch 'dev/trunk'
          [ https://svn.apache.org/r1542080 ]

          SOLR-5399: fix windows test issue

          Show
          ASF subversion and git services added a comment - Commit 1542080 from Robert Muir in branch 'dev/trunk' [ https://svn.apache.org/r1542080 ] SOLR-5399 : fix windows test issue
          Hide
          Robert Muir added a comment -

          Thanks Tomas: I committed this.

          Show
          Robert Muir added a comment - Thanks Tomas: I committed this.
          Hide
          ASF subversion and git services added a comment -

          Commit 1542082 from Robert Muir in branch 'dev/branches/branch_4x'
          [ https://svn.apache.org/r1542082 ]

          SOLR-5399: fix windows test issue

          Show
          ASF subversion and git services added a comment - Commit 1542082 from Robert Muir in branch 'dev/branches/branch_4x' [ https://svn.apache.org/r1542082 ] SOLR-5399 : fix windows test issue

            People

            • Assignee:
              Ryan Ernst
              Reporter:
              Tomás Fernández Löbbe
            • Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development