-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
infoschema: rewrite SchemaSimpleTableInfos for infoschema v2 to avoid network #55088
Conversation
Hi @tiancaiamao. Thanks for your PR. PRs from untrusted users cannot be marked as trusted with I understand the commands that are listed here. 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 kubernetes-sigs/prow repository. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #55088 +/- ##
================================================
+ Coverage 72.8506% 73.4399% +0.5893%
================================================
Files 1562 1576 +14
Lines 439181 458644 +19463
================================================
+ Hits 319946 336828 +16882
- Misses 99531 101095 +1564
- Partials 19704 20721 +1017
Flags with carried forward coverage won't be shown. Click here to find out more.
|
/retest |
@tiancaiamao: Cannot trigger testing until a trusted user reviews the PR and leaves an In response to this:
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 kubernetes-sigs/prow repository. |
/retest |
@tiancaiamao: Cannot trigger testing until a trusted user reviews the PR and leaves an In response to this:
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 kubernetes-sigs/prow repository. |
/retest |
@tiancaiamao: Cannot trigger testing until a trusted user reviews the PR and leaves an In response to this:
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 kubernetes-sigs/prow repository. |
retry: | ||
dbInfo, ok := is.SchemaByName(schema) | ||
if !ok { | ||
// Ascend is much more difficult than Descend. |
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.
what do you mean by difficult
, difficult to implement?
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.
Handle it in Ascend order is more difficult than handle it in Descend order.
The data organize like this:
| t1 | t2 | t3 |
| v5 v6 v7 v8 v10 v12 | v7 v13 | v12 v15 |
If we want infoschma snapshot at v10, the result should be [t1.v10 t2.v7]
In Descend order, the total test condition could be:
if is.infoSchema.schemaMetaVersion >= item.schemaVersion {
if curr == nil || curr.tableName != tableItems[i].tableName {
// add curr to the result
}
}
But in Ascend order, you may have a try to see how much more difficult
:-)
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: lance6716, wjhuang2016 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
[LGTM Timeline notifier]Timeline:
|
@tiancaiamao: The following test failed, say
Full PR test history. Your PR dashboard. 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 kubernetes/test-infra repository. I understand the commands that are listed here. |
/test check-dev |
@tiancaiamao: Cannot trigger testing until a trusted user reviews the PR and leaves an In response to this:
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 kubernetes-sigs/prow repository. |
What problem does this PR solve?
Issue Number: ref #50959
Problem Summary:
What changed and how does it work?
HTTP API for schema table is a burden for infoschema v2 when there are a lot of tables.
In the past, we have change SchemaTable to SimpleSchemaTableInfos, i.e. from full
model.TableInfo
tomodel.TableNameInfo
to reduce the cost.SimpleSchemaTableInfos fetch the table name and id using meta API, fetch data from tikv.
As we store all the name->id mapping now, we can avoid the network API.
Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.