Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-17148

Config API lies about setting cache enabled=false

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 9.6
    • config-api
    • None

    Description

      Using the stock solr gettingstarted example, you can run the command below and it will give all evidence that it has disabled the document cache:

      curl -X POST 'http://localhost:8983/solr/gettingstarted/config/' -H'Content-type: application/json' -d '{"set-property":{"query.documentCache.enabled":false}}'
      
      • Api command succeeds
      • configoverlay.json is updated in ZK
      • SolrCore reloads happen for all of the replicas of this collection

      ...but doesn't actually disable the cache. It's still there and in use (easy to verify by executing queries and looking at metrics)

      Explicitly stopping & restarting the solr nodes doesn't fix the problem either.

      They enabled property name appears to be explicitly allowed by the Config API, because trying to set other arbitrary properties fails (even when supported by the CaffieneCache impl)...

      $ curl -X POST 'http://localhost:8983/solr/gettingstarted/config/' -H'Content-type: application/json' -d '{"set-property":{"query.documentCache.async":false}}'
      {
        "responseHeader":{
          "status":400,
          "QTime":8},
        "errorMessages":["error processing commands, errors: [{errorMessages=['query.documentCache.async' is not an editable property], set-property={query.documentCache.async=false}}], \n"],
      

      ...suggesting that modifying the enabled property is intentionally supported – but doesn't work.

       


       

      A quick & dirty workaround is setting the size=-1 and ignoring the ERROR in the logs on every newSearcher...

      curl -X POST 'http://localhost:8983/solr/gettingstarted/config/' -H'Content-type: application/json' -d '{"set-property":{"query.documentCache.size":-1}}'
      

      (Which seems to indicate that whatever the problem is, it's specific to enabled – and not a general problem with modifying cache configuration via the Config API)

      Attachments

        Issue Links

          Activity

            People

              epugh Eric Pugh
              hossman Chris M. Hostetter
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h 40m
                  1h 40m