-
Notifications
You must be signed in to change notification settings - Fork 495
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
br: a more straight forward operator interface #5710
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #5710 +/- ##
==========================================
- Coverage 61.47% 61.42% -0.05%
==========================================
Files 235 235
Lines 30653 30854 +201
==========================================
+ Hits 18843 18952 +109
- Misses 9920 9991 +71
- Partials 1890 1911 +21
|
For the state machine figure, please also add the scenarios where the state change due to gc-ttl. @RidRisR |
we can't modify advancer time out setting now. therefore, the gc-ttl will only time out after 24 hours, it seems too long for a test. |
pkg/apis/pingcap/v1alpha1/backup.go
Outdated
switch backup.Spec.LogSubcommand { | ||
case "": | ||
fallthrough | ||
case LogStartCommand: | ||
if IsLogBackupAlreadyPaused(backup) { | ||
subCommand = LogResumeCommand | ||
} else { | ||
subCommand = LogStartCommand | ||
} | ||
case LogStopCommand: | ||
subCommand = LogStopCommand | ||
case LogPauseCommand: | ||
subCommand = LogPauseCommand | ||
default: | ||
return LogUnknownCommand |
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 set LogSubcommand
as ""
, what the subcommand will be used, log-unkown
or log-start
.
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.
Let me make it more clear:
- Actually we don't need the "" as a subcommand. The only reason we keep it is for compatible with the old version interface.
The old usage is demonstrated here: br: add log backup, include start, truncate, stop #4682
TL;DR
In the old version, we use tthe following CRD to start a new task. Therefore,LogSubcommand == ""
meansLogStartCommand
:
Spec:
# empty field
-
I add
LogUnknownCommand
for handling unexpected input from users, but now we use+kubebuilder:validation:Enum
instead. This field is useless now. I keep it just for a double insurance. -
Now I refactored the code in the new commit, I suppose it could be more clear now.
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: WangLe1321 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
[LGTM Timeline notifier]Timeline:
|
New changes are detected. LGTM label has been removed. |
@RidRisR: Your PR was out of date, I have automatically updated it for you. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
/run-pull-e2e-kind-br |
2 similar comments
/run-pull-e2e-kind-br |
/run-pull-e2e-kind-br |
What problem does this PR solve?
Closes #5699
What is changed and how does it work?
Now, the crd to control log backup would loops like
(If no subcommand is provided, the default value is
log-start
)If the task is not created before:
It could transfer to
running
state usinglog-start
If the task is running:
It could transfer to
paused
state usinglog-pause
It could transfer to
stop
state usinglog-stop
If the task is paused:
It could transfer to
running
state usinglog-start
It could transfer to
stop
state usinglog-stop
If the task is stopped:
This is the end state and can't transfer state again
As long as the task is created, user could set
logTruncateUntil
and truncate would be sync after subcommand is doneCode changes
Tests
Side effects
Related changes
Release Notes
Please refer to Release Notes Language Style Guide before writing the release note.