-
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
[DO NOT MERGE] traffic mirroring proof-of-concept #14872
[DO NOT MERGE] traffic mirroring proof-of-concept #14872
Conversation
Signed-off-by: Max Englander <[email protected]>
Signed-off-by: Max Englander <[email protected]>
Signed-off-by: Max Englander <[email protected]>
d12e2cf
to
bee9858
Compare
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. |
Signed-off-by: Max Englander <[email protected]>
8db0226
to
b28d2a8
Compare
Signed-off-by: Max Englander <[email protected]>
50a6f4d
to
c963fd7
Compare
Signed-off-by: Max Englander <[email protected]>
c963fd7
to
8d21447
Compare
@@ -37,7 +38,7 @@ type Plan struct { | |||
Instructions Primitive // Instructions contains the instructions needed to fulfil the query. | |||
BindVarNeeds *sqlparser.BindVarNeeds // Stores BindVars needed to be provided as part of expression rewriting | |||
Warnings []*query.QueryWarning // Warnings that need to be yielded every time this query runs | |||
TablesUsed []string // TablesUsed is the list of tables that this plan will query | |||
TablesUsed sqlparser.TableNames // TablesUsed is the list of tables that this plan will query |
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 change was made to enable planbuilder
to figure out which keyspaces the original plan touches, and use that information to figure out whether/how to build a mirror plan, without having to do strings.Split
.
engine.NewPercentMirrorTarget(percent, target.primitive), | ||
) | ||
tables := append(from.tables, target.tables...) | ||
operators.SortTableNames(tables) |
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.
AFAICT we only need table names to be sorted for logging/stats purposes, e.g. so that planbuilder
tests are consistent. Maybe we can delay sorting until it's needed?
Signed-off-by: Max Englander <[email protected]>
if table.Qualifier.NotEmpty() { | ||
tablesUsed[i] = fmt.Sprintf("%s.%s", table.Qualifier.String(), table.Name.String()) | ||
} else { | ||
tablesUsed[i] = table.Name.String() | ||
} |
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 table.Qualifier.NotEmpty() { | |
tablesUsed[i] = fmt.Sprintf("%s.%s", table.Qualifier.String(), table.Name.String()) | |
} else { | |
tablesUsed[i] = table.Name.String() | |
} | |
tablesUsed[i] = sqlparser.String(table) |
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.
@systay the problem with that is it adds backticks around keyspace names and tables. Which I guess isn't really a problem if we're OK with updating all the planbuilder
tests and any other tests that use this info?
HasMirrorRules() bool | ||
} | ||
|
||
// mirrorVSchema is a wrapper which returns mirrored versions of values |
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.
can we move mirrorVSchema
to it's own file?
Description
This is a proof-of-concept PR.
main
.Related Issue(s)
#13772