Skip to content
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

cluster: add significant warning when --force is set for scale-in #1629

Merged
merged 2 commits into from
Nov 22, 2021

Conversation

AstroProfundis
Copy link
Contributor

@AstroProfundis AstroProfundis commented Nov 19, 2021

What problem does this PR solve?

The argument --force for command scale-in is unsafe and ignores errors, it should only be used when the target node is already offline and impossible to connect.

However, some users might try to use scale-in --force to delete TiKV instances if it is stuck in Pending Offline status, and thus lead to broken region or data loss.

Close #1630

What is changed and how it works?

Add a significant warning sign in ASCII art to get the user fully aware, and require the user to type in "Yes, I know my data might be lost." instead of simply y/n to confirm the operation.

Also add a specific note that scale-in --force should not be used if there are any "Pending Offline" instances.
图片

Check List

Tests

  • Manual test (add detailed scripts or steps below)

Code changes

  • Has exported function/method change

Related changes

  • Need to cherry-pick to the release branch

Release notes:

NONE

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Nov 19, 2021

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • nexustar

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@AstroProfundis AstroProfundis self-assigned this Nov 19, 2021
@ti-chi-bot ti-chi-bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Nov 19, 2021
@codecov-commenter
Copy link

codecov-commenter commented Nov 19, 2021

Codecov Report

Merging #1629 (7ef1087) into master (2afffed) will increase coverage by 28.61%.
The diff coverage is 0.00%.

Impacted file tree graph

@@             Coverage Diff             @@
##           master    #1629       +/-   ##
===========================================
+ Coverage   15.60%   44.21%   +28.61%     
===========================================
  Files         151      292      +141     
  Lines       15225    26734    +11509     
===========================================
+ Hits         2376    11821     +9445     
- Misses      12332    13043      +711     
- Partials      517     1870     +1353     
Flag Coverage Δ
cluster 34.93% <0.00%> (?)
dm 26.20% <0.00%> (?)
integrate 44.21% <0.00%> (+28.61%) ⬆️
playground 13.35% <0.00%> (?)
tiup 15.59% <0.00%> (-0.01%) ⬇️
unittest ∅ <ø> (∅)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
pkg/cluster/manager/scale_in.go 48.21% <0.00%> (ø)
pkg/tui/tui.go 52.11% <0.00%> (+26.30%) ⬆️
pkg/cluster/task/monitored_config.go 57.89% <0.00%> (ø)
components/dm/command/patch.go 59.09% <0.00%> (ø)
pkg/cluster/operation/systemd.go 0.00% <0.00%> (ø)
components/cluster/command/display.go 32.46% <0.00%> (ø)
pkg/cluster/task/scale_config.go 53.84% <0.00%> (ø)
pkg/cluster/manager/builder.go 76.83% <0.00%> (ø)
components/dm/ansible/import.go 0.00% <0.00%> (ø)
components/cluster/command/restart.go 43.75% <0.00%> (ø)
... and 230 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2afffed...7ef1087. Read the comment docs.

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Nov 19, 2021
@AstroProfundis
Copy link
Contributor Author

/merge

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: 7ef1087

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Nov 22, 2021
@ti-chi-bot ti-chi-bot merged commit 6b1719c into pingcap:master Nov 22, 2021
@AstroProfundis AstroProfundis deleted the warn-force-scalein branch November 24, 2021 04:23
@qqqdan qqqdan added this to the v1.7.1 milestone Nov 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/M Denotes a PR that changes 30-99 lines, ignoring generated files. status/can-merge Indicates a PR has been approved by a committer. status/LGT1 Indicates that a PR has LGTM 1.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

scale-in --force action needs a more obvious warning information
5 participants