Lucene - Core
  1. Lucene - Core
  2. LUCENE-5196

Revive LTC.PREFLEX_IMPERSONATION_IS_ACTIVE

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.5, Trunk
    • Component/s: general/test
    • Labels:
      None
    • Lucene Fields:
      New, Patch Available

      Description

      This constant is currently not used and from what I understand, it was used in the past to test 3.x stuff? Anyway, I want to revive it by renaming it to OLD_FORMAT_IMPERSONATION_IS_ACTIVE (defaults to true) and have the RWCodecs respect it by not supporting e.g. fieldsConsumer() if it's set to false. This will allow tests that want to verify e.g. old formats are not supported work.

      Currently it's impossible because the RWCodec gets loaded before the non-RW by SPI, and so writing segments in an old format always work. I want to test something like that in LUCENE-5189 and prevents it.

      Will post a patch soon.

      1. LUCENE-5196.patch
        12 kB
        Shai Erera
      2. LUCENE-5196.patch
        10 kB
        Shai Erera

        Activity

        Shai Erera created issue -
        Hide
        Shai Erera added a comment -

        Patch adds LuceneTestCase.OLD_FORMAT_IMPERSONATION_IS_ACTIVE, defaults to true and fixes the RW codecs to respect it. I also added TestCodecs.testDisableImpersonation.

        Show
        Shai Erera added a comment - Patch adds LuceneTestCase.OLD_FORMAT_IMPERSONATION_IS_ACTIVE, defaults to true and fixes the RW codecs to respect it. I also added TestCodecs.testDisableImpersonation.
        Shai Erera made changes -
        Field Original Value New Value
        Attachment LUCENE-5196.patch [ 12600926 ]
        Hide
        Shai Erera added a comment -

        More formats respect impersonation. But with this 'ant test -Dtestcase=TestCodecs -Dtests.method=testDisableImpersonation -Dtests.seed=62DBD22C772F3E85' the test fails. What I see is that Lucene41RWCodec is used, and it succeeds to write a posting. The reason is that Lucene41PostingsFormat is the latest and so still 'valid'. But it's confusing that Lucene41Codec can be used to write postings, yet not DocValues, just because the postings format hasn't changed. Is that a bug or should I modify the test to allow "Lucene41" and "Lucene42" to write postings?

        Show
        Shai Erera added a comment - More formats respect impersonation. But with this 'ant test -Dtestcase=TestCodecs -Dtests.method=testDisableImpersonation -Dtests.seed=62DBD22C772F3E85' the test fails. What I see is that Lucene41RWCodec is used, and it succeeds to write a posting. The reason is that Lucene41PostingsFormat is the latest and so still 'valid'. But it's confusing that Lucene41Codec can be used to write postings, yet not DocValues, just because the postings format hasn't changed. Is that a bug or should I modify the test to allow "Lucene41" and "Lucene42" to write postings?
        Shai Erera made changes -
        Attachment LUCENE-5196.patch [ 12600930 ]
        Hide
        Shai Erera added a comment -

        Maybe it's not so confusing. 41 supports writing postings and if all you index are terms, it's Ok to use it. I'll modify the test to always add both postings and doc values.

        Show
        Shai Erera added a comment - Maybe it's not so confusing. 41 supports writing postings and if all you index are terms, it's Ok to use it. I'll modify the test to always add both postings and doc values.
        Hide
        ASF subversion and git services added a comment -

        Commit 1519258 from Shai Erera in branch 'dev/trunk'
        [ https://svn.apache.org/r1519258 ]

        LUCENE-5196: add LuceneTestCase.OLD_FORMAT_IMPERSONATION_IS_ACTIVE

        Show
        ASF subversion and git services added a comment - Commit 1519258 from Shai Erera in branch 'dev/trunk' [ https://svn.apache.org/r1519258 ] LUCENE-5196 : add LuceneTestCase.OLD_FORMAT_IMPERSONATION_IS_ACTIVE
        Hide
        ASF subversion and git services added a comment -

        Commit 1519260 from Shai Erera in branch 'dev/branches/branch_4x'
        [ https://svn.apache.org/r1519260 ]

        LUCENE-5196: add LuceneTestCase.OLD_FORMAT_IMPERSONATION_IS_ACTIVE

        Show
        ASF subversion and git services added a comment - Commit 1519260 from Shai Erera in branch 'dev/branches/branch_4x' [ https://svn.apache.org/r1519260 ] LUCENE-5196 : add LuceneTestCase.OLD_FORMAT_IMPERSONATION_IS_ACTIVE
        Hide
        Shai Erera added a comment -

        Committed to trunk and 4x. For 4x, I left PREFLEX_IMPERSONATION and added the new OLD_FORMAT_IMPERSONATION, otherwise TestBackwardsCompatibility3x failed. And looking at the code, keeping that logic as it was seemed to make sense.

        Show
        Shai Erera added a comment - Committed to trunk and 4x. For 4x, I left PREFLEX_IMPERSONATION and added the new OLD_FORMAT_IMPERSONATION, otherwise TestBackwardsCompatibility3x failed. And looking at the code, keeping that logic as it was seemed to make sense.
        Shai Erera made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 5.0 [ 12321663 ]
        Fix Version/s 4.5 [ 12324742 ]
        Resolution Fixed [ 1 ]
        Hide
        Adrien Grand added a comment -

        4.5 release -> bulk close

        Show
        Adrien Grand added a comment - 4.5 release -> bulk close
        Adrien Grand made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        1d 6h 44m 1 Shai Erera 01/Sep/13 13:01
        Resolved Resolved Closed Closed
        33d 22h 17m 1 Adrien Grand 05/Oct/13 11:18

          People

          • Assignee:
            Shai Erera
            Reporter:
            Shai Erera
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development