Skip to content

coprocessor: return bucket version not match error if the given bucket's version is stale#15224

Merged
ti-chi-bot[bot] merged 20 commits intotikv:masterfrom
bufferflies:version_not_match
Aug 22, 2023
Merged

coprocessor: return bucket version not match error if the given bucket's version is stale#15224
ti-chi-bot[bot] merged 20 commits intotikv:masterfrom
bufferflies:version_not_match

Conversation

@bufferflies
Copy link
Contributor

@bufferflies bufferflies commented Jul 27, 2023

What is changed and how it works?

Issue Number: Close #15123, #15121

client-go : tikv/client-go#918

What's Changed:

reject cop request if the given buckets verison is stale, 
 and return the new error called `bucket_version_not_match` which will carry with the latest bucket keys, 
so the client should update it cache depend on this errror. And then split this 
cop request again.

Related changes

Check List

Tests

  • Unit test
  • Integration test

Side effects

Release note

 return bucket version not match error if the given bucket's version is stale

Signed-off-by: bufferflies <1045931706@qq.com>
Signed-off-by: bufferflies <1045931706@qq.com>
Signed-off-by: bufferflies <1045931706@qq.com>
Signed-off-by: bufferflies <1045931706@qq.com>
Signed-off-by: bufferflies <1045931706@qq.com>
Signed-off-by: bufferflies <1045931706@qq.com>
Signed-off-by: bufferflies <1045931706@qq.com>
Signed-off-by: bufferflies <1045931706@qq.com>
Signed-off-by: bufferflies <1045931706@qq.com>
Signed-off-by: bufferflies <1045931706@qq.com>
Signed-off-by: bufferflies <1045931706@qq.com>
Signed-off-by: bufferflies <1045931706@qq.com>
Signed-off-by: bufferflies <1045931706@qq.com>
@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Jul 27, 2023

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • SpadeA-Tang
  • overvenus

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.

Details

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

@ti-chi-bot ti-chi-bot bot added do-not-merge/needs-linked-issue do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note Denotes a PR that will be considered when it comes time to generate release notes. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jul 27, 2023
Signed-off-by: bufferflies <1045931706@qq.com>
@ti-chi-bot ti-chi-bot bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jul 27, 2023
Signed-off-by: bufferflies <1045931706@qq.com>
@ti-chi-bot ti-chi-bot bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jul 27, 2023
@bufferflies bufferflies marked this pull request as ready for review July 28, 2023 01:33
@ti-chi-bot ti-chi-bot bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 28, 2023
tracker.req_ctx.context.buckets_version!=0 {
let mut bucket_not_match = errorpb::BucketVersionNotMatch::default();
bucket_not_match.set_version(buckets.version);
bucket_not_match.set_keys(buckets.keys.clone().into());
Copy link
Member

Choose a reason for hiding this comment

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

Is there any size limit of coprocessor response? Can it cause error grpc: received message larger than max ...?

Copy link
Contributor Author

@bufferflies bufferflies Aug 3, 2023

Choose a reason for hiding this comment

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

the grpc send limit: Maximum value: 2147483647. buckets keys can't exceed than it even than 100GB/50MB=2000 keys .If happened, the buckets report also met this problem.

@bufferflies bufferflies requested a review from overvenus August 21, 2023 03:23
@ti-chi-bot ti-chi-bot bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed do-not-merge/needs-linked-issue size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Aug 21, 2023
@overvenus
Copy link
Member

Please fix CI, rest LGTM.

Signed-off-by: bufferflies <1045931706@qq.com>
@bufferflies
Copy link
Contributor Author

Please fix CI, rest LGTM.

all ut passed

@ti-chi-bot ti-chi-bot bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Aug 22, 2023
@overvenus
Copy link
Member

/merge

@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Aug 22, 2023

@overvenus: It seems you want to merge this PR, I will help you trigger all the tests:

/run-all-tests

You only need to trigger /merge once, and if the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes.

If you have any questions about the PR merge process, please refer to pr process.

Details

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.

@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Aug 22, 2023

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

DetailsCommit hash: adcfde6

@ti-chi-bot ti-chi-bot bot added the status/can-merge Indicates a PR has been approved by a committer. label Aug 22, 2023
@bufferflies bufferflies removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 22, 2023
@bufferflies
Copy link
Contributor Author

/rebuild

@ti-chi-bot ti-chi-bot bot merged commit d7fc4b3 into tikv:master Aug 22, 2023
@ti-chi-bot ti-chi-bot bot added this to the Pool milestone Aug 22, 2023
@bufferflies bufferflies deleted the version_not_match branch August 22, 2023 09:12
@bufferflies bufferflies added the needs-cherry-pick-release-7.1 Should cherry pick this PR to release-7.1 branch. label Oct 10, 2023
ti-chi-bot pushed a commit to ti-chi-bot/tikv that referenced this pull request Oct 10, 2023
close tikv#15123

Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-7.1: #15743.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-cherry-pick-release-7.1 Should cherry pick this PR to release-7.1 branch. release-note Denotes a PR that will be considered when it comes time to generate release notes. 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/LGT2 Indicates that a PR has LGTM 2.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Dynamic Regions] Notify TiDB that its bucket might be stale if a coprocessor key range covers multiple buckets

5 participants