Skip to content
This repository has been archived by the owner on Nov 24, 2023. It is now read-only.

*: limit checker error at a finer granularity and auto increase max size #1624

Merged
merged 12 commits into from
May 13, 2021

Conversation

lance6716
Copy link
Collaborator

@lance6716 lance6716 commented Apr 22, 2021

What problem does this PR solve?

close #1478

What is changed and how it works?

  • when RPC returned grpc: received message larger than max (5242885 vs. 4194304), increase max message size and retry
  • update dependency to limit the warn/error count at a finer granularity, and pretty print precheck errors

Check List

Tests

  • Unit test

Related changes

  • Need to cherry-pick to the release branch
  • Need to be included in the release note

@ti-chi-bot ti-chi-bot added size/L and removed size/M labels Apr 24, 2021
@lance6716 lance6716 force-pushed the update-checker branch 2 times, most recently from e8fd5f0 to 685baf2 Compare April 24, 2021 13:56
@lance6716 lance6716 changed the title [WIP] checker: update returning structure of checker *: limit checker error at a finer granularity and auto increase max size Apr 24, 2021
@lance6716 lance6716 added needs-cherry-pick-release-2.0 This PR should be cherry-picked to release-2.0. Remove this label after cherry-picked to release-2.0 needs-update-release-note This PR should be added into release notes. Remove this label once the release notes are updated labels Apr 24, 2021
@lance6716 lance6716 added this to the v2.0.3 milestone Apr 24, 2021
checker/checker.go Show resolved Hide resolved
Comment on lines 32 to 35
"github.com/pingcap/dm/pkg/log"

"github.com/pingcap/dm/dm/config"
"github.com/pingcap/dm/dm/pb"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fmt

Copy link
Collaborator Author

@lance6716 lance6716 Apr 25, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is caused by our make fmt @Ehco1996 PTAL

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

our fmt tools just can't group this imports correctly... but you can formart manually - -.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you fix these imports manually?

case codes.ResourceExhausted:
matches := re.FindStringSubmatch(err.Error())
if len(matches) == 3 {
msgSize, err2 := strconv.Atoi(matches[1])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we increase msgSize a little more?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unit test shows this is enough

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will the result become a little bigger for the second request?

Copy link
Collaborator Author

@lance6716 lance6716 Apr 25, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can't decide a reasonable delta for "a little bigger" 🤔

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I'm just afraid it's too strict sometimes.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a hard limit of gRPC message size? And how about use next_pow_of_2(msg_size) as the new limit

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a hard limit of gRPC message size?

MaxInt. This only has memory affects. next_pow_of_2 seems more like a strategy for container capacity growing, while here I think using exactly the size is OK, because we sent the RPC again in a short time so the response is more likely not changed.

Copy link
Contributor

@lichunzhu lichunzhu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ti-chi-bot ti-chi-bot added the status/LGT1 One reviewer already commented LGTM label Apr 26, 2021
//nolint:errcheck
go server.Serve(lis)

conn, err := grpc.Dial(utils.UnwrapScheme(masterAddr),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should add defer conn.Close() here? 🤔

@lance6716
Copy link
Collaborator Author

/hold

@lance6716
Copy link
Collaborator Author

/unhold

@Ehco1996
Copy link
Contributor

/lgtm

@ti-chi-bot
Copy link
Member

@Ehco1996: /lgtm is only allowed for the reviewers in list.

In response to this:

/lgtm

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.

@lance6716 lance6716 modified the milestones: v2.0.3, v2.0.4 May 8, 2021
@lance6716
Copy link
Collaborator Author

/cc @glorv

@ti-chi-bot ti-chi-bot requested a review from glorv May 12, 2021 06:54
@glorv
Copy link
Collaborator

glorv commented May 13, 2021

/lgtm

@ti-chi-bot
Copy link
Member

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • glorv
  • lichunzhu

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 writing /lgtm in a comment.
Reviewer can cancel approval by writing /lgtm cancel in a comment.

@ti-chi-bot ti-chi-bot added status/LGT2 Two reviewers already commented LGTM, ready for merge and removed status/LGT1 One reviewer already commented LGTM labels May 13, 2021
@lance6716
Copy link
Collaborator Author

/merge

@ti-chi-bot
Copy link
Member

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

Commit hash: 62ce2a2

@lance6716
Copy link
Collaborator Author

/merge

@ti-chi-bot
Copy link
Member

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

Commit hash: bbc0ca1

@Ehco1996
Copy link
Contributor

/run-compatibility-test

@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created: #1688.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs-cherry-pick-release-2.0 This PR should be cherry-picked to release-2.0. Remove this label after cherry-picked to release-2.0 needs-update-release-note This PR should be added into release notes. Remove this label once the release notes are updated size/L status/can-merge status/LGT2 Two reviewers already commented LGTM, ready for merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

grpc has a message limit, so long error message can't be received by dmctl
5 participants