Uploaded image for project: 'Apache Avro'
  1. Apache Avro
  2. AVRO-2294

The schema validator reports false negatives for any incompatible change to an enum type

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.8.2
    • None
    • java
    • None

    Description

      The schema validator reports false negatives for any incompatible change to an enum type. I found this bug when invoking the SchemaValidatorBuilder.mutualReadStrategy() method via Confluent's Schema Registry.

      This bug can be traced to the Symbol.hasErrors() method. When it is invoked with a Symbol.EnumAdjustAction object, it always (and therefore incorrectly) returns false. This is a problem because these objects can definitely have errors—masquerading along side adjustments.

      The root cause of this bug has to do with objects of the Symbol.EnumAdjustAction class being assigned a Kind.EXPLICIT_ACTION kind. This kind informs the Symbol.hasErrors() method to always return false without checking if there are any errors hiding inside the object's adjustments.

      As best I understand, there are a few possible solutions:

      1. Fix the Symbol.hasErrors() method so it checks the objects adjustments.
      2. Fix the Symbol.EnumAdjustAction class so its objects have a different kind.
      3. Fix both 1 and 2.

      I'm not 100% familiar with the intention of the Symbol class. However, if given a little guidance on the preferred solution, I'm happy to submit a pull request to fix the bug.

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            ryansobol Ryan Sobol
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: