Solr
  1. Solr
  2. SOLR-6179

ManagedResource repeatedly logs warnings when not used

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 4.8, 4.8.1
    • Fix Version/s: 4.10, 6.0
    • Component/s: None
    • Labels:
      None

      Description

      These messages are currently logged as WARNings, and should either be switched to INFO level (or made more sophisticated so that it can tell when solr is setup for managed resources but the data isn't available)...

      2788 [coreLoadExecutor-5-thread-1] WARN  org.apache.solr.rest.ManagedResource  – No stored data found for /rest/managed
      2788 [coreLoadExecutor-5-thread-1] WARN  org.apache.solr.rest.ManagedResource  – No registered observers for /rest/managed
      

        Issue Links

          Activity

          Hide
          Hoss Man added a comment -

          spin off of SOLR-6128

          Show
          Hoss Man added a comment - spin off of SOLR-6128
          Hide
          Hoss Man added a comment -

          (fixed description - was in "enviornment" by mistake)


          Part of the issue here is that "No stored data found for..." message is actually fairly important it most cases – if you are actively using managed resources (for something like managed synonyms) this WARN log type message is the only thing that will help you catch a possible situation where the storage file got deleted out from under you inadvertantly.

          This is really very similar to the way we currently log a warning on startup if there is not "index" directory – it's an exceptional enough situation that we want to warn you about it so that you can find it in your logs later if things aren't working as you expect – but as soon as we log that warning we continue with the assumption that it's expected and we should automatically create it for you

          The right solution here is probably:

          • Anytime ManageResource sees that no storage exists for something it's managing, it should immediately create an "empty" storage for it and log a WARN along the lines of "No stored data found for /rest/foo/bar/yak .... creating new empty storage"
            • This will mean that as people upgrade from old versions of solr to new versions of solr, they get this WARN exactly once for /rest/managed as the new (empty file is created)
            • If/when people add new managed analysis factories to their schema.xml, they will likewise get a WARN once as empty storage files are created (even if they restart several times before they PUT any stopwords/synonyms into these managed resources)
          • In our example configs, just like we ship pre-populated _schema_analysis_stopwords_english.json and _schema_analysis_synonyms_english.json files, we should ship a "pre-populated" (ie: empty) _rest_managed.json file
            • which would ensure that no new user, who starts fresh with the "current" example configs, ever sees a warning about "No stored data found for /rest/managed"

          The "No registered observers for..." message seems like something that has no business being a WARN, and should be switched to DEBUG or INFO – but i may just be missunderstanding the purpose of that message.

          Show
          Hoss Man added a comment - (fixed description - was in "enviornment" by mistake) Part of the issue here is that "No stored data found for..." message is actually fairly important it most cases – if you are actively using managed resources (for something like managed synonyms) this WARN log type message is the only thing that will help you catch a possible situation where the storage file got deleted out from under you inadvertantly. This is really very similar to the way we currently log a warning on startup if there is not "index" directory – it's an exceptional enough situation that we want to warn you about it so that you can find it in your logs later if things aren't working as you expect – but as soon as we log that warning we continue with the assumption that it's expected and we should automatically create it for you The right solution here is probably: Anytime ManageResource sees that no storage exists for something it's managing, it should immediately create an "empty" storage for it and log a WARN along the lines of "No stored data found for /rest/foo/bar/yak .... creating new empty storage" This will mean that as people upgrade from old versions of solr to new versions of solr, they get this WARN exactly once for /rest/managed as the new (empty file is created) If/when people add new managed analysis factories to their schema.xml, they will likewise get a WARN once as empty storage files are created (even if they restart several times before they PUT any stopwords/synonyms into these managed resources) In our example configs, just like we ship pre-populated _schema_analysis_stopwords_english.json and _schema_analysis_synonyms_english.json files, we should ship a "pre-populated" (ie: empty) _rest_managed.json file which would ensure that no new user, who starts fresh with the "current" example configs, ever sees a warning about "No stored data found for /rest/managed" The "No registered observers for..." message seems like something that has no business being a WARN, and should be switched to DEBUG or INFO – but i may just be missunderstanding the purpose of that message.
          Hide
          Timothy Potter added a comment -

          Sounds like a good approach, I'll get that implemented. And, yes, the "No registered observers for..." message should be changed to DEBUG. Thanks Hoss.

          Show
          Timothy Potter added a comment - Sounds like a good approach, I'll get that implemented. And, yes, the "No registered observers for..." message should be changed to DEBUG. Thanks Hoss.
          Hide
          ASF subversion and git services added a comment -

          Commit 1607102 from Timothy Potter in branch 'dev/trunk'
          [ https://svn.apache.org/r1607102 ]

          SOLR-6179: Better strategy for handling empty managed data to avoid spurious warning messages in the logs.

          Show
          ASF subversion and git services added a comment - Commit 1607102 from Timothy Potter in branch 'dev/trunk' [ https://svn.apache.org/r1607102 ] SOLR-6179 : Better strategy for handling empty managed data to avoid spurious warning messages in the logs.
          Hide
          ASF subversion and git services added a comment -

          Commit 1607128 from Timothy Potter in branch 'dev/trunk'
          [ https://svn.apache.org/r1607128 ]

          SOLR-6179: Fix unit test breakage by using InMemory storage if config dir is not writable.

          Show
          ASF subversion and git services added a comment - Commit 1607128 from Timothy Potter in branch 'dev/trunk' [ https://svn.apache.org/r1607128 ] SOLR-6179 : Fix unit test breakage by using InMemory storage if config dir is not writable.
          Hide
          Timothy Potter added a comment -

          Going to keep an eye on this on Jenkins today and then backport (and update the CHANGES.txt as needed).

          Show
          Timothy Potter added a comment - Going to keep an eye on this on Jenkins today and then backport (and update the CHANGES.txt as needed).
          Hide
          ASF subversion and git services added a comment -

          Commit 1607150 from Timothy Potter in branch 'dev/trunk'
          [ https://svn.apache.org/r1607150 ]

          SOLR-6179: Include the RestManager stored data file to prevent warning when starting the example (and to prevent dirty checkouts when running example from svn)

          Show
          ASF subversion and git services added a comment - Commit 1607150 from Timothy Potter in branch 'dev/trunk' [ https://svn.apache.org/r1607150 ] SOLR-6179 : Include the RestManager stored data file to prevent warning when starting the example (and to prevent dirty checkouts when running example from svn)
          Hide
          Timothy Potter added a comment -

          Commit logs for branch_4x:

          r1610907 | thelabdude | 2014-07-15 21:27:54 -0600 (Tue, 15 Jul 2014) | 1 line
          Changed paths:
          M /lucene/dev/branches/branch_4x/solr/example/solr/collection1/conf/_rest_managed.json

          SOLR-6179: fix eol prop issue found for precommit
          ------------------------------------------------------------------------
          r1610870 | thelabdude | 2014-07-15 16:14:27 -0600 (Tue, 15 Jul 2014) | 1 line
          Changed paths:
          M /lucene/dev/branches/branch_4x/solr/CHANGES.txt
          M /lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/rest/ManagedResource.java
          M /lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/rest/ManagedResourceStorage.java
          M /lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/rest/RestManager.java
          M /lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/rest/schema/analysis/ManagedWordSetResource.java
          M /lucene/dev/branches/branch_4x/solr/core/src/test/org/apache/solr/rest/TestRestManager.java
          A /lucene/dev/branches/branch_4x/solr/example/solr/collection1/conf/_rest_managed.json

          SOLR-6179: Better strategy for handling empty managed data to avoid spurious warning messages in the logs.

          Show
          Timothy Potter added a comment - Commit logs for branch_4x: r1610907 | thelabdude | 2014-07-15 21:27:54 -0600 (Tue, 15 Jul 2014) | 1 line Changed paths: M /lucene/dev/branches/branch_4x/solr/example/solr/collection1/conf/_rest_managed.json SOLR-6179 : fix eol prop issue found for precommit ------------------------------------------------------------------------ r1610870 | thelabdude | 2014-07-15 16:14:27 -0600 (Tue, 15 Jul 2014) | 1 line Changed paths: M /lucene/dev/branches/branch_4x/solr/CHANGES.txt M /lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/rest/ManagedResource.java M /lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/rest/ManagedResourceStorage.java M /lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/rest/RestManager.java M /lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/rest/schema/analysis/ManagedWordSetResource.java M /lucene/dev/branches/branch_4x/solr/core/src/test/org/apache/solr/rest/TestRestManager.java A /lucene/dev/branches/branch_4x/solr/example/solr/collection1/conf/_rest_managed.json SOLR-6179 : Better strategy for handling empty managed data to avoid spurious warning messages in the logs.

            People

            • Assignee:
              Timothy Potter
              Reporter:
              Hoss Man
            • Votes:
              1 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development