Skip to content

VReplication: refactored and enhanced support for JSON columns#6829

Merged
deepthi merged 9 commits intovitessio:masterfrom
planetscale:rn-vr-json-columns
Nov 4, 2020
Merged

VReplication: refactored and enhanced support for JSON columns#6829
deepthi merged 9 commits intovitessio:masterfrom
planetscale:rn-vr-json-columns

Conversation

@rohit-nayak-ps
Copy link
Copy Markdown
Member

@rohit-nayak-ps rohit-nayak-ps commented Oct 6, 2020

This is a major refactor of the support for JSON columns in vreplication. The key changes are:

  • a two pass parser using an intermediate AST and the ajson package. Parsing of the binlog json representation generates an ajson AST. Producing the json string to apply changes in sql on the target is done by ajson's unmarshall functionality. This removes code for escaping strings which added complexity and was buggy. Also the code used to do both steps in a single pass making it difficult to maintain.

  • more tests added for vreplication code paths

  • added tests for "large" json docs

  • needed to cast json columns to utf8mb4 during vreplication since we use binary charsets, due to this bug https://bugs.mysql.com/bug.php?id=93052 fixed in MySQL 8.0.14

Note

  • partial json is still not supported.
  • it has been suggested that stored columns are a std pattern used alongside json columns to materialize bits of the json column. Stored columns are not yet supported by vreplication

@rohit-nayak-ps rohit-nayak-ps force-pushed the rn-vr-json-columns branch 3 times, most recently from 62efcb7 to 9e2b0db Compare October 12, 2020 21:48
@rohit-nayak-ps rohit-nayak-ps force-pushed the rn-vr-json-columns branch 3 times, most recently from 68b5d25 to d990e25 Compare October 20, 2020 05:32
@rohit-nayak-ps rohit-nayak-ps changed the title WIP: VReplication support for JSON columns VReplication: refactored and enhanced support for JSON columns Oct 22, 2020
@rohit-nayak-ps rohit-nayak-ps marked this pull request as ready for review October 22, 2020 05:52
@sougou
Copy link
Copy Markdown
Contributor

sougou commented Oct 26, 2020

Are all comments addressed? If so, we can merge this.

implementation for mysql57 flavors

Signed-off-by: Rohit Nayak <rohit@planetscale.com>
Signed-off-by: Rohit Nayak <rohit@planetscale.com>
…cs, debug logs

Signed-off-by: Rohit Nayak <rohit@planetscale.com>
Signed-off-by: Rohit Nayak <rohit@planetscale.com>
Signed-off-by: Rohit Nayak <rohit@planetscale.com>
Signed-off-by: Rohit Nayak <rohit@planetscale.com>
Signed-off-by: Rohit Nayak <rohit@planetscale.com>
Signed-off-by: Rohit Nayak <rohit@planetscale.com>
Signed-off-by: Rohit Nayak <rohit@planetscale.com>
@deepthi deepthi merged commit f0bf54c into vitessio:master Nov 4, 2020
@deepthi deepthi deleted the rn-vr-json-columns branch November 4, 2020 15:44
@askdba askdba added this to the v9.0 milestone Nov 11, 2020
setassociative pushed a commit to tinyspeck/vitess that referenced this pull request Mar 11, 2021
VReplication: refactored and enhanced support for JSON columns

Signed-off-by: Richard Bailey <rbailey@slack-corp.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants