-
Notifications
You must be signed in to change notification settings - Fork 9.8k
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
add warning message when delete to release-3.5 #13748
Conversation
/assign @ptabor |
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 I understand correctly, the only case we want to issue a warning is case
that happens in line 72 of the original code:
opts = append(opts, clientv3.WithRange(args[1]))
i.e. the flags like --prefix',
--from-keyor (to be added)
--range` are not given...
The code should IMHO print warning only iff:
- none of the flag is given
- the command has 2 arguments.
BTW: I would still recommend submiting a PR to main adding the --range
flag and warning .... and backport it to 3.5 later.
According to your advice. I sumbit this to release-3.5 |
1960aa6
to
6801502
Compare
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.
I think it does not work....
It prints warning only
etcdctl/ctlv3/command/del_command.go
Outdated
@@ -91,5 +96,9 @@ func getDelOp(args []string) (string, []clientv3.OpOption) { | |||
opts = append(opts, clientv3.WithFromKey()) | |||
} | |||
|
|||
if !ignoreWarn { | |||
fmt.Fprintf(os.Stderr, "Warning: will delete servarl keys.") |
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.
I would state it as:
Warning: This operations is implicitly deleting range of keys. Please add flag `--range` to make it explicit. Will sleep in v3.5.
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.
I would state it as:
Warning: This operations is implicitly deleting range of keys. Please add flag `--range` to make it explicit. Will sleep in v3.5.
This PR commit to release-3.5?
Should we chang to this
Warning: This operations is implicitly deleting range of keys.
When commit to main:
> Warning: This operations is implicitly deleting range of keys. Please add flag `--range` to make it explicit. Will sleep in v3.6.
If we want add --range
to 3.5. Please take a look #13747. If merged, we cherry-pick to release-3.5.
Do we need --range
in release-3.5?
6801502
to
445836b
Compare
Why the warning message in this PR is different from the message in 13747 ? This is a kind of enhancement, so in my opinion it should NOT be backported to 3.5. However it's just a very minor change, I will not insist on this if other maintainers/reviewers approve this PR. |
445836b
to
3fb7a93
Compare
Copy from #13705 (comment)
|
3fb7a93
to
6b9e981
Compare
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.
LGTM
cc @serathius @spzala @ptabor Please see my comment issuecomment-1126916984.
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 PR adds Sleep(2sec) to 3.5, so has potential to break customer's workflows thus cannot be accepted.
I'm for submitting just warning+flag to 3.5, to let customer's prepare for 3.6, but the message needs to be adjusted.
6b9e981
to
f055a4f
Compare
The message has been adjusted to #13748 (comment) |
5a59b27
to
25ff3c7
Compare
etcdctl/ctlv3/command/del_command.go
Outdated
"go.etcd.io/etcd/pkg/v3/cobrautl" | ||
"os" | ||
"time" |
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.
Please try to group the import entries properly. The build-in package os
, time
and fmt
should be grouped together and above other packages.
@ptabor was requesting to remove the |
25ff3c7
to
c529c47
Compare
Please sign off the commit.
|
4c2715d
to
00f1987
Compare
Looks good to me now, @ptabor Do you have any comments? |
Just to be clearer, this PR is a partially backporting of #13747 This is a minor enhancement for the What's your opinion? @ptabor @spzala @serathius If there is no response, then I assume there is no interest on this PR for 3.5. Then we can close it. |
@@ -70,6 +73,9 @@ func getDelOp(args []string) (string, []clientv3.OpOption) { | |||
cobrautl.ExitWithError(cobrautl.ExitBadArgs, fmt.Errorf("too many arguments, only accept one argument when `--prefix` or `--from-key` is set")) | |||
} | |||
opts = append(opts, clientv3.WithRange(args[1])) | |||
if !delRange { | |||
fmt.Fprintln(os.Stderr, "Warning: This operations is implicitly deleting range of keys. Please add flag `--range` to make it explicit. Will sleep for a while in v3.6.") | |||
} |
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.
I agree with @ahrtr that Will sleep for a while...
is difficult to interpret. Sorry, I took longer to review, but I would suggest something like these:
In etcd v3.6, along with this warning, the delete operation will be suspended for a few seconds to provide the user time to verify range.
or
In etcd v3.6, the operation will be suspended for a few seconds to provide the user time to verify range.
or
In v3.6, the operation will be suspended for a few seconds to provide the user time to verify range.
Thanks @kkkkun
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.
ok, I would change to the second
In etcd v3.6, the operation will be suspended for a few seconds to provide the user time to verify range.
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.
Done!
@ahrtr I agree with your thoughts here. I am okay with backporting. Thanks! |
Signed-off-by: kkkkun <scuzk373x@gmail.com>
00f1987
to
6797856
Compare
Thanks @kkkkun |
Fixes #13705
Base PR: #13729
Change commit branch from main to release-3.5