Skip to content

OnlineDDL/VReplication: inconsistency between vcopier & vplayer when copying shuffled enum values #15349

@shlomi-noach

Description

@shlomi-noach

An OnlineDDL operation can change an enum value such that column ordering is changed. For example:

  • from ('red', 'green', 'blue') to ('red', 'blue') (blue changes ordinal from 2 to 1).
  • from ('red', 'green', 'blue') to ('blue', 'red', 'green') (everything changes ordinal).

Today, vcopier copies values by logical value (e.g. the string 'blue' rather than the ordinal 1), but vplayer copies values by ordinal value (because the binary log only contains ordinal values and the schema is unavailable).

As such, an Online DDL/VReplication operation will have an inconsistent value mapping and the end result is corrupted data.

vcopier and vplayer should be consistent with each other. Both should be using logical values, or both should be using ordinal values.

It's noteworthy that the problem is specific to Online DDL. All other vreplication workflows (MoveTables, Reshard etc.) preserve the column's schema, and specifically if the column is an enum, its values are unchanged, and therefore it doesn't matter if we copy by logical or by ordinal value.

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions