-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
WIP: VStreamer: improve representation of integers in json data types #9508
Conversation
…ssue of integers being parsed as float64 by the source binlog parser. This results in larger integers being stored as floats on the target and sent with scientific notation in vstream events. Signed-off-by: Rohit Nayak <rohit@planetscale.com>
Signed-off-by: Rohit Nayak <rohit@planetscale.com>
This PR is being marked as stale because it has been open for 30 days with no activity. To rectify, you may do any of the following:
If no action is taken within 7 days, this PR will be closed. |
This PR is being marked as stale because it has been open for 30 days with no activity. To rectify, you may do any of the following:
If no action is taken within 7 days, this PR will be closed. |
This PR was closed because it has been stale for 7 days with no activity. |
Can we proceed further with this PR? It might fix our issue with broken consistency during replication of big integers as floats inside JSON fields from a source database to Vitess shards /cc @rohit-nayak-ps |
Created bug report as well in the |
Review ChecklistHello reviewers! 👋 Please follow this checklist when reviewing this Pull Request. General
If a new flag is being introduced:
If a workflow is added or modified:
Bug fixes
Non-trivial changes
New/Existing features
Backward compatibility
|
Closed in favor of #12761 |
Description
The binlog parser in vstreamer uses the github.com/spyzhov/ajson module to decode the value from the binlog image to its json value. However the library only supports a single type Numeric (float64) as a catchall for all numeric types including signed and unsigned integers. Due to this the generated JSON represents integers as floats and the string representation in a vevent can contain decimals or values in a scientific notation. So integers can be stored as floats on the target and larger ints sent with scientific notation in vstream events.
This results in VDiff failures since the json strings stored are different. Also parsing the vevents sent using the VStream API can result in errors if, for example, the json is being parsed by golang. See #8686.
Note: This PR uses a forked version of the library https://github.com/rohit-nayak-ps/ajson that adds Integer and UnsignedInteger data type json Nodes. The Draft PR is pointing to that fork. More work (including more tests, addition of these types to the parsing flow) needs to be done before submitting a PR to upstream repo.
Related Issue(s)
#8686
Checklist
Deployment Notes