-
Notifications
You must be signed in to change notification settings - Fork 188
check: add error/warn count for check-task #1610
Conversation
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
dm/ctl/master/check_task.go
Outdated
@@ -28,10 +28,12 @@ import ( | |||
// NewCheckTaskCmd creates a CheckTask command. | |||
func NewCheckTaskCmd() *cobra.Command { | |||
cmd := &cobra.Command{ | |||
Use: "check-task <config-file>", | |||
Use: "check-task <config-file> [--errors] [--warns]", |
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.
It seems not consistent with L52?
Actually we read error
instead of errors
.
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
|
||
# 100 errors | ||
run_dm_ctl $WORK_DIR "127.0.0.1:$MASTER_PORT" \ | ||
"check-task $cur/conf/dm-task3.yaml -e 100 -w 1" \ |
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.
Use --error
and --warn
here?
"check-task $cur/conf/dm-task3.yaml -e 100 -w 1" \ | |
"check-task $cur/conf/dm-task3.yaml --error 100 --warn 1" \ |
/lgtm |
[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 writing |
/merge |
This pull request has been accepted and is ready to merge. Commit hash: 2a7c5e6
|
@@ -75,14 +75,18 @@ type Checker struct { | |||
sync.RWMutex | |||
detail *check.Results | |||
} | |||
errCnt int64 |
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.
Is it make sense to restrict the total length of the errors or the total numbers of error + warn instead of set two different count separately. e.g. if we think be default we only return 20 messages, then if errors + warns <= 20, we needn't truncate any messages.
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 error has a higher priority than warning, so if user gets 20 warnings and 1 errors we should make sure we will display that errors.
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.
we could loop the results twice to make sure errors have higher priority 🤔 I'm OK with current two settings, let's wait glorv
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'm ok, too. I just wonder if this implementation is user-friendly enough to use since the goal is to solve the message too long issue.
BTW, I think maybe there are some cases the user just wants to emit the warning message, thus the --warn
parameter can be used.
Co-authored-by: glorv <glorvs@163.com>
Co-authored-by: glorv <glorvs@163.com>
/hold |
we now disable it by passing a big value instead of -1 🤔 |
cobra doesn't support negative argument... I keep the negative for other callings (like precheck of start-task). But now we use 10 as the default in every call, so I remove it. |
wait @glorv to cancel the hold |
DM-143 is failed because we didn't support optimistic sharding with PARTITION |
/unhold |
/run-all-tests |
1 similar comment
/run-all-tests |
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
cherry pick to release-2.0 in PR #1621 |
What problem does this PR solve?
close #1478
What is changed and how it works?
add error/warn count for check-task, default is 10
Check List
Tests