Skip to content

Schema tracking: initial schema insert#6435

Merged
sougou merged 6 commits intovitessio:masterfrom
planetscale:rn-schema-tracking-initial-schema
Jul 16, 2020
Merged

Schema tracking: initial schema insert#6435
sougou merged 6 commits intovitessio:masterfrom
planetscale:rn-schema-tracking-initial-schema

Conversation

@rohit-nayak-ps
Copy link
Copy Markdown
Member

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
Copy Markdown
Member 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
Copy Markdown
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
Copy Markdown
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