-
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
EXPERIMENTAL breaking down the vreplication flow #8044
Closed
shlomi-noach
wants to merge
37
commits into
vitessio:main
from
planetscale:vreplication-shorter-snapshots
Closed
Changes from all commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
7d649b0
wip-vreplication-experiments
shlomi-noach c8e0924
Merge branch 'master' into vreplication-shorter-snapshots
shlomi-noach 6a1b630
Merge branch 'master' into vreplication-shorter-snapshots
shlomi-noach 7f30ea1
limit queries by maxpk
shlomi-noach 4af712b
debug: print entire query
shlomi-noach 362fab1
Merge branch 'master' into vreplication-shorter-snapshots
shlomi-noach 24ccafd
Merge branch 'master' into vreplication-shorter-snapshots
shlomi-noach dcfc7ed
Merge branch 'master' into vreplication-shorter-snapshots
shlomi-noach f62e9dd
Merge branch 'master' into vreplication-shorter-snapshots
shlomi-noach 0b4f34f
Merge branch 'master' into vreplication-shorter-snapshots
shlomi-noach c1a8fdd
marge master; resolve conflicts
shlomi-noach 8bdf422
Merge branch 'master' into vreplication-shorter-snapshots
shlomi-noach f8073ac
unit test
shlomi-noach bc61eec
unit test
shlomi-noach a456174
safe short sql for debug
shlomi-noach e6f8d9f
expect 'replace into'
shlomi-noach 11b02c3
short sql
shlomi-noach 7811c72
expect 'replace'
shlomi-noach d46a1a6
fix unit tests
shlomi-noach 7125705
Merge branch 'master' into vreplication-shorter-snapshots
shlomi-noach 274fdd8
simplify test: accept substring, so that either 'insert into' or 'rep…
shlomi-noach 90f6e4a
fix more insert/replace test cases
shlomi-noach a45384f
running with 'lightweight' snapshot, where transaction is created wit…
shlomi-noach e204d2c
lightweight wasn't a good idea. We need GTID to be <= row-copy
shlomi-noach 80b3003
one extra fastforward, because our last actual batch of rows does not…
shlomi-noach 212bfad
fast forward whenever a GTID is provided
shlomi-noach c1a438d
only REPLACE when no GROUP BY
shlomi-noach bed4c36
increase WaitForVReplicationToCatchup timeout
shlomi-noach 94d814b
remove 'moreRows' logic, which adds a 5sec interval round trip to a s…
shlomi-noach ba772b6
add strictSnapshot bool, by which rowstreamer decides whether to run …
shlomi-noach c085c83
remove unused debug code
shlomi-noach ea21e74
reverting changes to vcopier; there's actually no logic changes neede…
shlomi-noach 219cfd2
read rs.strictSnapshot from query comment directives
shlomi-noach f06f541
table_plan_builder injects strictSnapshot in query comment
shlomi-noach 1188034
Merge branch 'main' into vreplication-shorter-snapshots
shlomi-noach 9898bad
merge main, resolve conflict
shlomi-noach cca0d9b
remove redundant function argument
shlomi-noach File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -277,8 +277,17 @@ func buildTablePlan(tableName string, rule *binlogdatapb.Rule, colInfoMap map[st | |
}, | ||
}) | ||
} | ||
sendRule.Filter = sqlparser.String(tpb.sendSelect) | ||
|
||
strictSnapshot := false | ||
switch tpb.onInsert { | ||
case insertOnDup, insertIgnore: | ||
strictSnapshot = true | ||
} | ||
comments := sqlparser.Comments{ | ||
fmt.Sprintf(`/*vt+ strictSnapshot=%v */`, strictSnapshot), | ||
} | ||
tpb.sendSelect.Comments = comments | ||
sendRule.Filter = sqlparser.String(tpb.sendSelect) | ||
tablePlan := tpb.generate() | ||
tablePlan.SendRule = sendRule | ||
tablePlan.EnumValuesMap = enumValuesMap | ||
|
@@ -568,6 +577,9 @@ func (tpb *tablePlanBuilder) generateInsertStatement() *sqlparser.ParsedQuery { | |
func (tpb *tablePlanBuilder) generateInsertPart(buf *sqlparser.TrackedBuffer) *sqlparser.ParsedQuery { | ||
if tpb.onInsert == insertIgnore { | ||
buf.Myprintf("insert ignore into %v(", tpb.name) | ||
} else if tpb.onInsert == insertNormal { | ||
// the condition (tpb.onInsert == insertNormal) is true when there is no GROUP BY | ||
buf.Myprintf("replace into %v(", tpb.name) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Still WIP,
|
||
} else { | ||
buf.Myprintf("insert into %v(", tpb.name) | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
*
is a new "magic" prefix (like/
is a magic prefix) that indicates "this is expected to be a substring in the actual result"