Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
shlomi-noach opened this issue Feb 25, 2024 · 0 comments · Fixed by #15103

Comments

@shlomi-noach
Copy link
Contributor

shlomi-noach commented Feb 25, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant