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

UpdateLog should throw an exception when serializing unknown types

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 6.1
    • Component/s: None
    • Labels:
      None

      Description

      When JavaBinCodec encounters a class it doesn't have explicit knowledge of how to serialize, nor does it implement the ObjectResolver interface, it currently serializes the object as the classname, colon, then toString() of the object.

      This may appear innocent but not throwing an exception hides bugs. One example is that the UpdateLog, which uses JavaBinCodec, to save a document. The result is that this bad value winds up there, gets deserialized as a String in PeerSync (which uses /get) and then this value pretends to be a suitable value to the final document in the leader. But of course it isn't.

        Issue Links

          Activity

          Hide
          dsmiley David Smiley added a comment -

          Here's a patch. I isolated the change to TransactionLog.java and added a test. I don't love where I put the test but I'm not sure of a more suitable place.

          Originally I tried making the change on JavaBinCodec but there are a bunch of things that get serialized by BinaryResponseWriter like a Lucene Explaination, Directory, and Java Throwable. Possibly others. So instead of playing wack-a-mole there I limited the scope of this to where it's most important.

          Tests pass.

          Show
          dsmiley David Smiley added a comment - Here's a patch. I isolated the change to TransactionLog.java and added a test. I don't love where I put the test but I'm not sure of a more suitable place. Originally I tried making the change on JavaBinCodec but there are a bunch of things that get serialized by BinaryResponseWriter like a Lucene Explaination, Directory, and Java Throwable. Possibly others. So instead of playing wack-a-mole there I limited the scope of this to where it's most important. Tests pass.
          Hide
          yseeley@gmail.com Yonik Seeley added a comment -

          +1, looks fine.

          Show
          yseeley@gmail.com Yonik Seeley added a comment - +1, looks fine.
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit a22099a3986de1f36f926b4e106827c5308708b0 in lucene-solr's branch refs/heads/master from David Smiley
          [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=a22099a ]

          SOLR-8866: UpdateLog now throws an error if it can't serialize a field value

          Show
          jira-bot ASF subversion and git services added a comment - Commit a22099a3986de1f36f926b4e106827c5308708b0 in lucene-solr's branch refs/heads/master from David Smiley [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=a22099a ] SOLR-8866 : UpdateLog now throws an error if it can't serialize a field value
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit 4ee908eb80c4f37c53e2e1572654079aaad8b56f in lucene-solr's branch refs/heads/branch_6x from David Smiley
          [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=4ee908e ]

          SOLR-8866: UpdateLog now throws an error if it can't serialize a field value
          (cherry picked from commit a22099a)

          Show
          jira-bot ASF subversion and git services added a comment - Commit 4ee908eb80c4f37c53e2e1572654079aaad8b56f in lucene-solr's branch refs/heads/branch_6x from David Smiley [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=4ee908e ] SOLR-8866 : UpdateLog now throws an error if it can't serialize a field value (cherry picked from commit a22099a)
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit a22099a3986de1f36f926b4e106827c5308708b0 in lucene-solr's branch refs/heads/apiv2 from David Smiley
          [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=a22099a ]

          SOLR-8866: UpdateLog now throws an error if it can't serialize a field value

          Show
          jira-bot ASF subversion and git services added a comment - Commit a22099a3986de1f36f926b4e106827c5308708b0 in lucene-solr's branch refs/heads/apiv2 from David Smiley [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=a22099a ] SOLR-8866 : UpdateLog now throws an error if it can't serialize a field value
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit a22099a3986de1f36f926b4e106827c5308708b0 in lucene-solr's branch refs/heads/jira/SOLR-445 from David Smiley
          [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=a22099a ]

          SOLR-8866: UpdateLog now throws an error if it can't serialize a field value

          Show
          jira-bot ASF subversion and git services added a comment - Commit a22099a3986de1f36f926b4e106827c5308708b0 in lucene-solr's branch refs/heads/jira/ SOLR-445 from David Smiley [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=a22099a ] SOLR-8866 : UpdateLog now throws an error if it can't serialize a field value
          Hide
          steve_rowe Steve Rowe added a comment -

          Reopening to backport to 6.0.2, 5.6 and 5.5.2.

          Show
          steve_rowe Steve Rowe added a comment - Reopening to backport to 6.0.2, 5.6 and 5.5.2.
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit 8f64b63a0a47ba6d28984555956465600d9cd416 in lucene-solr's branch refs/heads/branch_5_5 from David Smiley
          [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=8f64b63 ]

          SOLR-8866: UpdateLog now throws an error if it can't serialize a field value
          (cherry picked from commit a22099a)

          Show
          jira-bot ASF subversion and git services added a comment - Commit 8f64b63a0a47ba6d28984555956465600d9cd416 in lucene-solr's branch refs/heads/branch_5_5 from David Smiley [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=8f64b63 ] SOLR-8866 : UpdateLog now throws an error if it can't serialize a field value (cherry picked from commit a22099a)
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit e04c11f2af087eb2b321a34fa0dd5c4866c02fac in lucene-solr's branch refs/heads/branch_5x from David Smiley
          [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=e04c11f ]

          SOLR-8866: UpdateLog now throws an error if it can't serialize a field value
          (cherry picked from commit a22099a)

          Show
          jira-bot ASF subversion and git services added a comment - Commit e04c11f2af087eb2b321a34fa0dd5c4866c02fac in lucene-solr's branch refs/heads/branch_5x from David Smiley [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=e04c11f ] SOLR-8866 : UpdateLog now throws an error if it can't serialize a field value (cherry picked from commit a22099a)
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit d2597ecace3da64397c5417905d1b439dbb2f675 in lucene-solr's branch refs/heads/branch_6_0 from David Smiley
          [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=d2597ec ]

          SOLR-8866: UpdateLog now throws an error if it can't serialize a field value
          (cherry picked from commit a22099a)

          Show
          jira-bot ASF subversion and git services added a comment - Commit d2597ecace3da64397c5417905d1b439dbb2f675 in lucene-solr's branch refs/heads/branch_6_0 from David Smiley [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=d2597ec ] SOLR-8866 : UpdateLog now throws an error if it can't serialize a field value (cherry picked from commit a22099a)
          Hide
          ctargett Cassandra Targett added a comment -

          Seems this one was re-opened to backport, but never got closed again.

          Show
          ctargett Cassandra Targett added a comment - Seems this one was re-opened to backport, but never got closed again.

            People

            • Assignee:
              dsmiley David Smiley
              Reporter:
              dsmiley David Smiley
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development