-
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
Schema tracking in vtgate #8074
Conversation
5c1c251
to
9f7a7ff
Compare
Signed-off-by: Harshit Gangal <[email protected]>
Signed-off-by: Andres Taylor <[email protected]>
Signed-off-by: Andres Taylor <[email protected]>
Signed-off-by: Andres Taylor <[email protected]>
Signed-off-by: Harshit Gangal <[email protected]>
8e6f5a3
to
410cd4c
Compare
Signed-off-by: Harshit Gangal <[email protected]>
36a4841
to
31294da
Compare
…vtopo.Server directly Signed-off-by: Harshit Gangal <[email protected]>
Signed-off-by: Harshit Gangal <[email protected]>
…rom schema tracker Signed-off-by: Harshit Gangal <[email protected]>
Signed-off-by: Andres Taylor <[email protected]>
Signed-off-by: Andres Taylor <[email protected]>
Signed-off-by: Andres Taylor <[email protected]>
Signed-off-by: Andres Taylor <[email protected]>
…ema.Tracker Signed-off-by: Andres Taylor <[email protected]>
Signed-off-by: Andres Taylor <[email protected]>
Co-authored-by: Andres Taylor <[email protected]> Signed-off-by: Florent Poinsard <[email protected]>
…chema when errors Signed-off-by: Florent Poinsard <[email protected]>
Signed-off-by: Florent Poinsard <[email protected]>
Signed-off-by: Florent Poinsard <[email protected]>
Signed-off-by: Florent Poinsard <[email protected]>
Signed-off-by: Andres Taylor <[email protected]>
0c52ebe
to
3c11a1c
Compare
Signed-off-by: Florent Poinsard <[email protected]>
Signed-off-by: Florent Poinsard <[email protected]>
Signed-off-by: Florent Poinsard <[email protected]>
Signed-off-by: Florent Poinsard <[email protected]>
Signed-off-by: Andres Taylor <[email protected]>
Signed-off-by: Andres Taylor <[email protected]>
7cada71
to
369ad4a
Compare
Co-authored-by: Andres Taylor <[email protected]> Signed-off-by: Florent Poinsard <[email protected]>
Co-authored-by: Andres Taylor <[email protected]> Signed-off-by: Florent Poinsard <[email protected]>
Signed-off-by: Florent Poinsard <[email protected]>
…tgate Signed-off-by: Andres Taylor <[email protected]>
Signed-off-by: Florent Poinsard <[email protected]>
Signed-off-by: Florent Poinsard <[email protected]>
Signed-off-by: Florent Poinsard <[email protected]>
clusterInstance.VtTabletExtraArgs = []string{"-queryserver-config-schema-change-signal"} | ||
err = clusterInstance.StartUnshardedKeyspace(*keyspace, 1, false) | ||
require.NoError(t, err) | ||
|
||
// teardown vttablets | ||
for _, vttablet := range clusterInstance.Keyspaces[0].Shards[0].Vttablets { | ||
err = vttablet.VttabletProcess.TearDown() | ||
require.NoError(t, err) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of starting tablets and shutting them down, we can test this by just creating the keyspace and shard in topo by calling vtctld APIs (CreateKeyspace and CreateShard). That will mimic the same behavior.
go/test/endtoend/vtgate/schematracker/loadkeyspace/schema_load_keyspace_test.go
Show resolved
Hide resolved
go/test/endtoend/vtgate/schematracker/restarttablet/schema_restart_test.go
Show resolved
Hide resolved
if v == nil { | ||
// We encountered an error, we should always have a current vschema | ||
log.Warning("got a schema changed signal with no loaded vschema. if this persist, something is wrong") | ||
vschema, _ = vindexes.BuildVSchema(&vschemapb.SrvVSchema{}) | ||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if currentSrvSchema
is nil we do not need to rebuild the VSchema as the empty VSchema would have been published to the subscriber through VSchemaUpdate
This should only be done in the case when we are using updated schema to enhance the VSchema
if vschema != nil { | ||
e.vschema = vschema | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can create an issue when a user wants to explicitly clear out the VSchema.
This check will ignore the update and will keep the old version.
Description
This adds a schema tracker that will update the vschema with schema information about tables and columns, fetched from the underlying MySQL instance.
Related Issue(s)
#7995
#7994
Checklist