Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This page is meant as a template for writing a FLIP. To create a FLIP choose Tools->Copy on this page and modify with your content and replace the heading with the next FLIP number and a description of your issue. Replace anything in italics with your own description.

Status

Current state: Under Discussion

...

Please keep the discussion on the mailing list rather than commenting on the wiki (wiki discussions get unwieldy fast).

Motivation

While restoring from a snapshot, StateBackend will resolve the schema compatibilty to decide where to go.

...

So reversing the direction of resolving schema compatibility could improve the usablitiy of schema evolution.

Public Interfaces

The public interface is the Typerserializer, see below.

Proposed Changes

TypeSerializer.java

Code Block
languagejava
titleTypeserializer.java
linenumberstrue
@PublicEvolving
public abstract class TypeSerializer<T> {
	// Check whether the serializer is compatible with the old one.
    public TypeSerializerSchemaCompatibility<T> resolveSchemaCompatibility(TypeSerializerSnapshot<T> typeSerializerSnapshot) {
		// Incompatible as default
		return TypeSerializerSchemaCompatibility.incompatible();
    }
}

...

else it will just use the resolving result of Typeserializer#resolveSchemaCompatibility.

Compatibility, Deprecation, and Migration Plan

If users haven't implement Typeserializer#resolveSchemaCompatibility, all behaviors are same as before. 

Test Plan

  1. Existing UT of resolving compatibility could verify whether the old behavior could work as before.
  2. Add extra UT to verify the correctness of self-defined serializer.
  3. Add ITCase and e2e test case to mock the user behavior.

Rejected Alternatives

None.