Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-6921

EnumValueSerializer cannot properly handle appended enum values

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 1.3.1, 1.4.0
    • Fix Version/s: 1.3.1
    • Labels:
      None

      Description

      The EnumValueSerializer fails with an ArrayIndexOutOfBoundsException if we try to ensure compatibility with an Enumeration which has added a field. The problem is that we don't check the array bounds of the array containing the enum names in ScalaEnumSerializerConfigSnapshot.

        Issue Links

          Activity

          Hide
          githubbot ASF GitHub Bot added a comment -

          GitHub user tillrohrmann opened a pull request:

          https://github.com/apache/flink/pull/4126

          FLINK-6921 [serializer] Allow EnumValueSerializer to deal with appended enum values

          The problem was that we don't check the bounds of the array with the enum names contained
          in the ScalaEnumSerializerConfigSnapshot.

          This PR also adds an Enumeration upgrade test which makes sure that appended fields are
          supported without migration. Moreover, it checks that a field removal and an order change
          leads to a required migration.

          cc @tzulitai

          You can merge this pull request into a Git repository by running:

          $ git pull https://github.com/tillrohrmann/flink addEnumValueSerializerTest

          Alternatively you can review and apply these changes as the patch at:

          https://github.com/apache/flink/pull/4126.patch

          To close this pull request, make a commit to your master/trunk branch
          with (at least) the following in the commit message:

          This closes #4126


          commit 0f2dcbab59185888137f2d0b278878f3d83c7aa2
          Author: Till Rohrmann <trohrmann@apache.org>
          Date: 2017-06-14T14:53:49Z

          FLINK-6921 [serializer] Allow EnumValueSerializer to deal with appended enum values

          The problem was that we don't check the bounds of the array with the enum names contained
          in the ScalaEnumSerializerConfigSnapshot.

          This PR also adds an Enumeration upgrade test which makes sure that appended fields are
          supported without migration. Moreover, it checks that a field removal and an order change
          leads to a required migration.


          Show
          githubbot ASF GitHub Bot added a comment - GitHub user tillrohrmann opened a pull request: https://github.com/apache/flink/pull/4126 FLINK-6921 [serializer] Allow EnumValueSerializer to deal with appended enum values The problem was that we don't check the bounds of the array with the enum names contained in the ScalaEnumSerializerConfigSnapshot. This PR also adds an Enumeration upgrade test which makes sure that appended fields are supported without migration. Moreover, it checks that a field removal and an order change leads to a required migration. cc @tzulitai You can merge this pull request into a Git repository by running: $ git pull https://github.com/tillrohrmann/flink addEnumValueSerializerTest Alternatively you can review and apply these changes as the patch at: https://github.com/apache/flink/pull/4126.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #4126 commit 0f2dcbab59185888137f2d0b278878f3d83c7aa2 Author: Till Rohrmann <trohrmann@apache.org> Date: 2017-06-14T14:53:49Z FLINK-6921 [serializer] Allow EnumValueSerializer to deal with appended enum values The problem was that we don't check the bounds of the array with the enum names contained in the ScalaEnumSerializerConfigSnapshot. This PR also adds an Enumeration upgrade test which makes sure that appended fields are supported without migration. Moreover, it checks that a field removal and an order change leads to a required migration.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user asfgit closed the pull request at:

          https://github.com/apache/flink/pull/4126

          Show
          githubbot ASF GitHub Bot added a comment - Github user asfgit closed the pull request at: https://github.com/apache/flink/pull/4126
          Hide
          tzulitai Tzu-Li (Gordon) Tai added a comment -

          Fixed for master via e520023ac768ac739537f7aa563f13aa208949ff.
          Fixed for 1.3.1 via 5d544b99b4aa18c0ff6fdcffdeb42a12ece533bb.

          Show
          tzulitai Tzu-Li (Gordon) Tai added a comment - Fixed for master via e520023ac768ac739537f7aa563f13aa208949ff. Fixed for 1.3.1 via 5d544b99b4aa18c0ff6fdcffdeb42a12ece533bb.
          Hide
          tzulitai Tzu-Li (Gordon) Tai added a comment -

          Thanks for the fix Till!

          Show
          tzulitai Tzu-Li (Gordon) Tai added a comment - Thanks for the fix Till!

            People

            • Assignee:
              till.rohrmann Till Rohrmann
              Reporter:
              till.rohrmann Till Rohrmann
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development