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

Adding Enum and Set metadata to VStream field event #6955

Closed
5 tasks
rohit-nayak-ps opened this issue Oct 27, 2020 · 1 comment
Closed
5 tasks

Adding Enum and Set metadata to VStream field event #6955

rohit-nayak-ps opened this issue Oct 27, 2020 · 1 comment
Assignees
Labels
Component: VReplication Type: Enhancement Logical improvement (somewhere between a bug and feature)

Comments

@rohit-nayak-ps
Copy link
Contributor

rohit-nayak-ps commented Oct 27, 2020

Motivation

The VStream API sends a Field event header for a table, prior to the first time it sends row events for a table. It also will send a new Field event if the schema of the table has changed since the last row event.

Currently the attributes sent are those sent by MySQL in its table_map RBR event. This does not include the valid values for Enum and Set columns. For this you need to query information_schema.columns. This has two problems:

  1. Those using the VStream API for Change Data Capture or related applications cannot depend on it for the schema information. They need the connection parameters for the database and make an out-of-band query to merge with the schema information returned by Vitess.

  2. The schema versioning functionality in Vitess is incomplete because it does not track updates to valid enum and set values.

This feature proposes to send valid values for Set and Enum types as part of the VStream API's Field event.

Tasks

  • Validate Set support in VReplication/VDiff

  • Changes in Schema Engine to add an optional list of valid values

  • Modify VStreamer to append this metadata to the field event

  • Modify schema tracker: add metadata to a new column to _vt.schema_versions

  • Refactor related tests: currently any change in the Field event requires touching tens of tests. Abstract some stuff out to make this easier in the future and also more readable

@rohit-nayak-ps
Copy link
Contributor Author

Closed via #6981

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: VReplication Type: Enhancement Logical improvement (somewhere between a bug and feature)
Projects
None yet
Development

No branches or pull requests

2 participants