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

fix deprecation warnings for absent (maxMergeDocs|mergeFactor)

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.5, 6.0
    • Fix Version/s: 5.5.1, 6.0
    • Component/s: None
    • Labels:
      None
    • Flags:
      Patch

      Description

      Markus Jelsma wrote on the solr-user mailing list:

      5.5.0 SOLR-8621 deprecation warnings without maxMergeDocs or mergeFactor

      ...

      o.a.s.c.Config Beginning with Solr 5.5, <maxMergeDocs> is deprecated, configure it on the relevant <mergePolicyFactory> instead.

      ...

      On my development machine for all cores. None of the cores has either parameter configured. Is this expected?

      ...

      Christine Poerschke replied:
      ...

      Could you advise if/that the solrconfig.xml has a <mergePolicy> element (for which deprecated warnings would appear separately) or that the solrconfig.xml has no <mergePolicyFactory> element?

      ...

      If either is the case then yes based on the code (SolrIndexConfig.java#L153) the warnings would be expected-and-harmless though admittedly are confusing, and fixable.

      ...

      1. SOLR-8734.patch
        3 kB
        Christine Poerschke
      2. SOLR-8734.patch
        3 kB
        Christine Poerschke

        Issue Links

          Activity

          Hide
          cpoerschke Christine Poerschke added a comment -

          Attaching proposed warnings fix patch against master.

          The proposed patch includes a fix/change of erroring/failing if a <maxMergeDocs|mergeFactor> is combined with a <mergePolicyFactory> element whereas the existing code would ignore the <mergePolicyFactory> element and use the default <mergePolicy> instead. Though perhaps that is too controversional a change in general or for any future 5.5.1 release in particular?

          Show
          cpoerschke Christine Poerschke added a comment - Attaching proposed warnings fix patch against master. The proposed patch includes a fix/change of erroring/failing if a <maxMergeDocs|mergeFactor> is combined with a <mergePolicyFactory> element whereas the existing code would ignore the <mergePolicyFactory> element and use the default <mergePolicy> instead. Though perhaps that is too controversional a change in general or for any future 5.5.1 release in particular?
          Hide
          cpoerschke Christine Poerschke added a comment -

          Simplified/Tweaked proposed patch a little.

          Show
          cpoerschke Christine Poerschke added a comment - Simplified/Tweaked proposed patch a little.
          Hide
          shaie Shai Erera added a comment -

          Patch looks good. Even while working on the previous issue I thought that we should be able to detect the existence of <mergeFactor> element in the .xml, and not compare the value to the default. What happens if someone includes both <mergePolicyFactory> and <mergeFactor> set to the default value? Would we also fail?

          Show
          shaie Shai Erera added a comment - Patch looks good. Even while working on the previous issue I thought that we should be able to detect the existence of <mergeFactor> element in the .xml, and not compare the value to the default. What happens if someone includes both <mergePolicyFactory> and <mergeFactor> set to the default value? Would we also fail?
          Hide
          cpoerschke Christine Poerschke added a comment -

          ... to detect the existence of <mergeFactor> element in the .xml, and not compare the value to the default. ...

          If I understood you right this means to distinguish

          ...
          <mergeFactor>-1</mergeFactor>
          <mergePolicy...>...</mergePolicy...>
          ...
          

          from

          <mergePolicy...>...</mergePolicy...>
          

          where -1 is the default value for the <mergeFactor> element. The motivation perhaps being that when SOLR-8668 removes <mergePolicy> (and <mergeFactor>) element support the <mergeFactor>-1</mergeFactor> likely would remain behind as a zombie element?

          Might we go even further than detecting the existence of a deprecated <mergeFactor> element and detect any and all unsupported elements? Unsupported elements could be simple typos on part of the user e.g. <mergePolicyFactor> instead of <mergePolicyFactory> or they could be misplaced elements e.g. test-files/solr/collection1/conf/solrconfig-spellcheckcomponent.xml seems to have indexConfig/query/maxWarmingSearchers when possibly query/maxWarmingSearchers was intended (SOLR-8682 exists for that).

          Show
          cpoerschke Christine Poerschke added a comment - ... to detect the existence of <mergeFactor> element in the .xml, and not compare the value to the default. ... If I understood you right this means to distinguish ... <mergeFactor>-1</mergeFactor> <mergePolicy...>...</mergePolicy...> ... from <mergePolicy...>...</mergePolicy...> where -1 is the default value for the <mergeFactor> element. The motivation perhaps being that when SOLR-8668 removes <mergePolicy> (and <mergeFactor>) element support the <mergeFactor>-1</mergeFactor> likely would remain behind as a zombie element? Might we go even further than detecting the existence of a deprecated <mergeFactor> element and detect any and all unsupported elements? Unsupported elements could be simple typos on part of the user e.g. <mergePolicyFactor> instead of <mergePolicyFactory> or they could be misplaced elements e.g. test-files/solr/collection1/conf/solrconfig-spellcheckcomponent.xml seems to have indexConfig/query/maxWarmingSearchers when possibly query/maxWarmingSearchers was intended ( SOLR-8682 exists for that).
          Hide
          markus17 Markus Jelsma added a comment -

          Hello these configurations have neither <mergePolicy> nor <mergePolicyFactory> configurated.

          Show
          markus17 Markus Jelsma added a comment - Hello these configurations have neither <mergePolicy> nor <mergePolicyFactory> configurated.
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit 0ed625b107264f2ed079b9e07e4f885b7398a6c4 in lucene-solr's branch refs/heads/master from Christine Poerschke
          [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=0ed625b ]

          SOLR-8734: fix (maxMergeDocs|mergeFactor) deprecation warnings: in solrconfig.xml <maxMergeDocs|mergeFactor> may not be combined with <mergePolicyFactory> and <maxMergeDocs|mergeFactor> on their own or combined with <mergePolicy> is a warning.

          Show
          jira-bot ASF subversion and git services added a comment - Commit 0ed625b107264f2ed079b9e07e4f885b7398a6c4 in lucene-solr's branch refs/heads/master from Christine Poerschke [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=0ed625b ] SOLR-8734 : fix (maxMergeDocs|mergeFactor) deprecation warnings: in solrconfig.xml <maxMergeDocs|mergeFactor> may not be combined with <mergePolicyFactory> and <maxMergeDocs|mergeFactor> on their own or combined with <mergePolicy> is a warning.
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit b1c06eed306366c54cccd71166a80fb4bb1d0235 in lucene-solr's branch refs/heads/branch_5x from Christine Poerschke
          [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=b1c06ee ]

          SOLR-8734: fix (maxMergeDocs|mergeFactor) deprecation warnings: in solrconfig.xml <maxMergeDocs|mergeFactor> may not be combined with <mergePolicyFactory> and <maxMergeDocs|mergeFactor> on their own or combined with <mergePolicy> is a warning.

          (Resolved conflict for solr/CHANGES.txt file.)

          Show
          jira-bot ASF subversion and git services added a comment - Commit b1c06eed306366c54cccd71166a80fb4bb1d0235 in lucene-solr's branch refs/heads/branch_5x from Christine Poerschke [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=b1c06ee ] SOLR-8734 : fix (maxMergeDocs|mergeFactor) deprecation warnings: in solrconfig.xml <maxMergeDocs|mergeFactor> may not be combined with <mergePolicyFactory> and <maxMergeDocs|mergeFactor> on their own or combined with <mergePolicy> is a warning. (Resolved conflict for solr/CHANGES.txt file.)
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit 55b3614fd37eeb1cf6ac2d2ef6c902d18e42d135 in lucene-solr's branch refs/heads/branch_5_5 from Christine Poerschke
          [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=55b3614 ]

          SOLR-8734: fix (maxMergeDocs|mergeFactor) deprecation warnings: in solrconfig.xml <maxMergeDocs|mergeFactor> may not be combined with <mergePolicyFactory> and <maxMergeDocs|mergeFactor> on their own or combined with <mergePolicy> is a warning.

          (Resolved conflict for solr/CHANGES.txt file.)

          Show
          jira-bot ASF subversion and git services added a comment - Commit 55b3614fd37eeb1cf6ac2d2ef6c902d18e42d135 in lucene-solr's branch refs/heads/branch_5_5 from Christine Poerschke [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=55b3614 ] SOLR-8734 : fix (maxMergeDocs|mergeFactor) deprecation warnings: in solrconfig.xml <maxMergeDocs|mergeFactor> may not be combined with <mergePolicyFactory> and <maxMergeDocs|mergeFactor> on their own or combined with <mergePolicy> is a warning. (Resolved conflict for solr/CHANGES.txt file.)
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit c7214a2ba5f96492e5c4cd6a558734217afe5089 in lucene-solr's branch refs/heads/branch_5_5 from Christine Poerschke
          [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=c7214a2 ]

          Merge 5.5.1 changes sections from SOLR-8737 and SOLR-8734 tickets.

          Show
          jira-bot ASF subversion and git services added a comment - Commit c7214a2ba5f96492e5c4cd6a558734217afe5089 in lucene-solr's branch refs/heads/branch_5_5 from Christine Poerschke [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=c7214a2 ] Merge 5.5.1 changes sections from SOLR-8737 and SOLR-8734 tickets.
          Hide
          cpoerschke Christine Poerschke added a comment -

          Thanks Markus for noticing and reporting this!

          Show
          cpoerschke Christine Poerschke added a comment - Thanks Markus for noticing and reporting this!

            People

            • Assignee:
              cpoerschke Christine Poerschke
              Reporter:
              cpoerschke Christine Poerschke
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development