-
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
Online DDL: better support for subsecond --force-cut-over-after
DDL strategy flag value.
#16635
Merged
harshit-gangal
merged 2 commits into
vitessio:main
from
planetscale:onlineddl-immediate-force-cut-over
Aug 23, 2024
Merged
Online DDL: better support for subsecond --force-cut-over-after
DDL strategy flag value.
#16635
harshit-gangal
merged 2 commits into
vitessio:main
from
planetscale:onlineddl-immediate-force-cut-over
Aug 23, 2024
Conversation
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
…ag means 'immediately' Signed-off-by: Shlomi Noach <[email protected]>
Signed-off-by: Shlomi Noach <[email protected]>
shlomi-noach
added
Type: Enhancement
Logical improvement (somewhere between a bug and feature)
Component: Online DDL
Online DDL (vitess/native/gh-ost/pt-osc)
labels
Aug 22, 2024
Review ChecklistHello reviewers! 👋 Please follow this checklist when reviewing this Pull Request. General
Tests
Documentation
New flags
If a workflow is added or modified:
Backward compatibility
|
vitess-bot
bot
added
NeedsBackportReason
If backport labels have been applied to a PR, a justification is required
NeedsDescriptionUpdate
The description is not clear or comprehensive enough, and needs work
NeedsIssue
A linked issue is missing for this Pull Request
NeedsWebsiteDocsUpdate
What it says
labels
Aug 22, 2024
shlomi-noach
removed
NeedsDescriptionUpdate
The description is not clear or comprehensive enough, and needs work
NeedsWebsiteDocsUpdate
What it says
NeedsIssue
A linked issue is missing for this Pull Request
NeedsBackportReason
If backport labels have been applied to a PR, a justification is required
labels
Aug 22, 2024
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #16635 +/- ##
=======================================
Coverage 68.98% 68.98%
=======================================
Files 1562 1562
Lines 200690 200690
=======================================
+ Hits 138449 138450 +1
+ Misses 62241 62240 -1 ☔ View full report in Codecov by Sentry. |
GuptaManan100
approved these changes
Aug 22, 2024
harshit-gangal
approved these changes
Aug 23, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Component: Online DDL
Online DDL (vitess/native/gh-ost/pt-osc)
Type: Enhancement
Logical improvement (somewhere between a bug and feature)
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.
Description
The
--force-cut-over-after
DDL strategy flag says "if we do a cut-over, how much time since the migration was ready to complete needs to pass before we force the cut-over".Normally we'd put values like
--force-cut-over-after=1h
to give the migration some chance to complete normally, but then at1h
be aggressive about cutting over.In testing, we sometimes want to force the cut-over on the very first attempt. Production users may want that, too. So we want to e.g. provide
--force-cut-over-after=1ns
(one nanosecond). However, we currently calculate the time sinceready_to_complete_timestamp
in the granularity of seconds. For testing in particular, but also possible for production, it is possible that the very first cut-over attempt happens within the same second range ofready_to_complete_timestamp
, which evaluates the time passed sinceready_to_complete_timestamp
as zero.The value of zero is of course always less than any nonzero value for
--force-cut-over-after
, so even a nanosecond fails the comparison, and this means the first cut-over attempt is not forced (ie does not kill queries & transactions).This PR fixes the issue by reading the timestamp difference in microseconds. The column value of
ready_to_complete_timestamp
is still seconds, but the "time since" evaluation compares the value withnow(6)
, which practically always produces a nonzero value.With this change a value of
--force-cut-over-after=1ns
can be safely trusted to ensure even the very first cut-over attempt is forced.Related Issue(s)
Fixes #16634
Checklist
Deployment Notes