-
Notifications
You must be signed in to change notification settings - Fork 287
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
dm: display instruction separately if precheck error is terror.Error #8201
Conversation
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
result.Errors = append(result.Errors, &Error{Severity: state, ShortErr: err.Error()}) | ||
if err2, ok := err.(*terror.Error); ok { | ||
result.Errors = append(result.Errors, &Error{Severity: state, ShortErr: err2.ErrorWithoutWorkaround()}) | ||
result.Instruction = err2.Workaround() |
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.
How does it look like?
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.
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.
Can we trim the [....],
from the short_error
? Looks confusing.
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.
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.
The Errors
may contain multiple errors, so instruction should also be prepraed for multiple lines?
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.
precheck item returns on first error(not failed to precheck kind of error, it's the error that we cannot run precheck normally) meet. if error passed into it is a multi-err instance(tables check), use the else
branch.
result.Errors = append(result.Errors, &Error{Severity: state, ShortErr: err.Error()}) | ||
if err2, ok := err.(*terror.Error); ok { | ||
result.Errors = append(result.Errors, &Error{Severity: state, ShortErr: err2.ErrorWithoutWorkaround()}) | ||
result.Instruction = err2.Workaround() |
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.
Can we trim the [....],
from the short_error
? Looks confusing.
@@ -204,15 +204,21 @@ func (e *Error) Workaround() string { | |||
return e.workaround | |||
} | |||
|
|||
// Error implements error interface. | |||
func (e *Error) Error() string { | |||
// ErrorWithoutWorkaround returns err msg without workaround, in some place like cloud we want display it separately. |
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 remember the instruction
fields have been filled for all the check items (i.e., Results[i].Instruction
). Where can we use this function?
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 precheck fail with err, there is no instruction. it's used in markCheckError
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.
tiflow/dm/pkg/checker/privilege.go
Lines 110 to 114 in a2d2a52
err2 := verifyPrivilegesWithResult(result, grants, dumpRequiredPrivs) | |
if err2 != nil { | |
result.Errors = append(result.Errors, err2) | |
result.Instruction = "Please grant the required privileges to the account." | |
} else { |
The instruction
is set in the Result
and dm-on-cloud
uses this field as the solution
. Do you mean it's only used in op?
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.
rest lgtm
result.Errors = append(result.Errors, &Error{Severity: state, ShortErr: err.Error()}) | ||
if err2, ok := err.(*terror.Error); ok { | ||
result.Errors = append(result.Errors, &Error{Severity: state, ShortErr: err2.ErrorWithoutWorkaround()}) | ||
result.Instruction = err2.Workaround() |
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.
The Errors
may contain multiple errors, so instruction should also be prepraed for multiple lines?
6.6 branch created, will merge it |
/merge |
This pull request has been accepted and is ready to merge. Commit hash: 4f082b8
|
/run-engine-integration-test |
some unit tests are failed @D3Hunter
|
/run-all-tests |
/run-all-tests |
/merge |
This pull request has been accepted and is ready to merge. Commit hash: bb8ade8
|
/run-all-tests |
1 similar comment
/run-all-tests |
/run-verify |
What problem does this PR solve?
Issue Number: ref #4287
What is changed and how it works?
Check List
Tests
Questions
Will it cause performance regression or break compatibility?
Do you need to update user documentation, design documentation or monitoring documentation?
Release note