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

Schema tracking: initial schema insert #6435

Merged
merged 6 commits into from
Jul 16, 2020

Conversation

rohit-nayak-ps
Copy link
Contributor

Signed-off-by: Rohit Nayak rohit@planetscale.com

@rohit-nayak-ps rohit-nayak-ps force-pushed the rn-schema-tracking-initial-schema branch from fff5af4 to 52389b7 Compare July 10, 2020 10:10
Signed-off-by: Rohit Nayak <rohit@planetscale.com>
…I errors

Signed-off-by: Rohit Nayak <rohit@planetscale.com>
Signed-off-by: Rohit Nayak <rohit@planetscale.com>
@rohit-nayak-ps rohit-nayak-ps force-pushed the rn-schema-tracking-initial-schema branch from 52389b7 to cfe1867 Compare July 12, 2020 15:37
Signed-off-by: Rohit Nayak <rohit@planetscale.com>
Signed-off-by: Rohit Nayak <rohit@planetscale.com>
@rohit-nayak-ps
Copy link
Contributor Author

Sugu,

Can you check if the way I am getting the current gtid is fine (tr.currentPosition()) using engine.cp.connect() ...

Also is it possible that there are some ts lifecycle issues that could come up: the schema engine should be properly initialized when the tracker Open() is called, right? I ask because legacy example test failed a couple of times but finally ran in CI. However they worked fine locally.

@rohit-nayak-ps rohit-nayak-ps marked this pull request as ready for review July 12, 2020 19:33
@rohit-nayak-ps rohit-nayak-ps requested a review from sougou as a code owner July 12, 2020 19:33
if err != nil {
return false, err
}
if result == nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This check is not needed. All APIs guarantee this will not be nil if there's no error.

if result == nil {
return false, fmt.Errorf("error querying _vt.schema_version")
}
if result.RowsAffected == 0 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's better to check len(result.Rows). There is no guarantee that this number will be accurate for non-DMLs. In the future, when we switch to streaming, this will always be 0.

Signed-off-by: Rohit Nayak <rohit@planetscale.com>
@sougou sougou merged commit 6032234 into vitessio:master Jul 16, 2020
@deepthi deepthi added this to the v7.0 milestone Jul 17, 2020
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.

3 participants