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

Add backward compatibility tests to JavaBinCodec's format.

    Details

    • Type: Test
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.8, 6.0
    • Component/s: None
    • Labels:
      None

      Description

      Since Solr guarantees backward compatibility of JavaBinCodec's format between releases, we should have tests for it.

      1. javabin_backcompat.bin
        0.2 kB
        Varun Thacker
      2. SOLR-5265.patch
        16 kB
        Varun Thacker
      3. SOLR-5265.patch
        8 kB
        Varun Thacker
      4. SOLR-5265.patch
        8 kB
        Varun Thacker
      5. SOLR-5265.patch
        5 kB
        Varun Thacker

        Activity

        Hide
        varunthacker Varun Thacker added a comment -

        An attempt at tackling this Jira -
        1. The test will ensure that if we ever change the byte values of existing variables in JavaBinCodec or if we write a type differently it will fail
        2. If new types are added to JavaBinCodec the test case and the binary file will have to be updated again

        There are a couple of nocommits but I wanted to know if I am on the right track.

        Show
        varunthacker Varun Thacker added a comment - An attempt at tackling this Jira - 1. The test will ensure that if we ever change the byte values of existing variables in JavaBinCodec or if we write a type differently it will fail 2. If new types are added to JavaBinCodec the test case and the binary file will have to be updated again There are a couple of nocommits but I wanted to know if I am on the right track.
        Hide
        noble.paul Noble Paul added a comment -

        don't use toString() to compare test actual values

        don't use FileInputstream, Use getClass().getResourceAsStream("/solrj/updateReq_4_5.bin") as given in TestUpdateRequestCodec

        add the rest of the types

        We also need a forward compatibility tests

        Show
        noble.paul Noble Paul added a comment - don't use toString() to compare test actual values don't use FileInputstream, Use getClass().getResourceAsStream("/solrj/updateReq_4_5.bin") as given in TestUpdateRequestCodec add the rest of the types We also need a forward compatibility tests
        Hide
        markrmiller@gmail.com Mark Miller added a comment -

        We also need a forward compatibility tests

        But we will happily take whatever someone wants to work on One way is better than none.

        We should try and minimize the effort needed to keep these tests working as we move through versions though.

        We may even want to look at something closer to how lucene does it back compat test run via using a previous release checkout.

        Show
        markrmiller@gmail.com Mark Miller added a comment - We also need a forward compatibility tests But we will happily take whatever someone wants to work on One way is better than none. We should try and minimize the effort needed to keep these tests working as we move through versions though. We may even want to look at something closer to how lucene does it back compat test run via using a previous release checkout.
        Hide
        varunthacker Varun Thacker added a comment -

        New Patch.

        • Need to apply the patch for SOLR-5837
        • Commented out Iterator type - JavaBinCodec writes an iterator but JavaBinCodec#readIterator returns a List
        • Made changes in JavaBinCodec#readMapEntry. Returning this also works
          return new AbstractMap.SimpleImmutableEntry(key, value);
          
        • Added a forward compatibility test
        Show
        varunthacker Varun Thacker added a comment - New Patch. Need to apply the patch for SOLR-5837 Commented out Iterator type - JavaBinCodec writes an iterator but JavaBinCodec#readIterator returns a List Made changes in JavaBinCodec#readMapEntry. Returning this also works return new AbstractMap.SimpleImmutableEntry(key, value); Added a forward compatibility test
        Hide
        varunthacker Varun Thacker added a comment -

        Same patch but attaching the binary file separately.

        Show
        varunthacker Varun Thacker added a comment - Same patch but attaching the binary file separately.
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1575932 from Noble Paul in branch 'dev/trunk'
        [ https://svn.apache.org/r1575932 ]

        SOLR-5265 Add backward compatibility tests to JavaBinCodec's format

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1575932 from Noble Paul in branch 'dev/trunk' [ https://svn.apache.org/r1575932 ] SOLR-5265 Add backward compatibility tests to JavaBinCodec's format
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1575936 from Noble Paul in branch 'dev/branches/branch_4x'
        [ https://svn.apache.org/r1575936 ]

        SOLR-5265 Add backward compatibility tests to JavaBinCodec's format

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1575936 from Noble Paul in branch 'dev/branches/branch_4x' [ https://svn.apache.org/r1575936 ] SOLR-5265 Add backward compatibility tests to JavaBinCodec's format
        Hide
        varunthacker Varun Thacker added a comment -

        New patch

        • Removed equals and hashCode implementations from SolrDocument, SolrInputDocument and SolrInputField.
        • Added assertSolrDocumentEquals(), assertSolrDocumentList(), assertSolrInputDocumentEquals(), assertSolrInputFieldEquals() to SolrTestCaseJ4
        • Migrated the test to use the asserts instead of equals
        Show
        varunthacker Varun Thacker added a comment - New patch Removed equals and hashCode implementations from SolrDocument, SolrInputDocument and SolrInputField. Added assertSolrDocumentEquals(), assertSolrDocumentList(), assertSolrInputDocumentEquals(), assertSolrInputFieldEquals() to SolrTestCaseJ4 Migrated the test to use the asserts instead of equals
        Hide
        thetaphi Uwe Schindler added a comment -

        Close issue after release of 4.8.0

        Show
        thetaphi Uwe Schindler added a comment - Close issue after release of 4.8.0

          People

          • Assignee:
            noble.paul Noble Paul
            Reporter:
            jpountz Adrien Grand
          • Votes:
            1 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development