-
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
lightning: replace information_schema query when importing table schema with separate show create table #58636
base: master
Are you sure you want to change the base?
Conversation
Hi @D3Hunter. 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 #58636 +/- ##
================================================
+ Coverage 73.1093% 73.7541% +0.6447%
================================================
Files 1676 1706 +30
Lines 463354 472131 +8777
================================================
+ Hits 338755 348216 +9461
+ Misses 103788 102378 -1410
- Partials 20811 21537 +726
Flags with carried forward coverage won't be shown. Click here to find out 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.
Copilot reviewed 2 out of 7 changed files in this pull request and generated no comments.
Files not reviewed (5)
- lightning/tests/lightning_character_sets/run.sh: Language not supported
- lightning/tests/lightning_no_schema/data/noschema.invalid-schema.sql: Language not supported
- lightning/tests/lightning_no_schema/data/noschema.invalid.sql: Language not supported
- lightning/tests/lightning_no_schema/run.sh: Language not supported
- pkg/lightning/mydump/BUILD.bazel: Language not supported
Comments suppressed due to low confidence (1)
pkg/lightning/mydump/schema_import.go:259
- Ensure that the new error handling logic in 'runCreateTableJob' and 'runCommonJob' is covered by tests.
func (si *SchemaImporter) runCreateTableJob(ctx context.Context, p *parser.Parser, job *schemaJob) error {
"github.com/pingcap/errors" | ||
"github.com/pingcap/tidb/br/pkg/storage" | ||
tmysql "github.com/pingcap/tidb/pkg/errno" |
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 package name errno is enough
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: lance6716 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:
|
What problem does this PR solve?
Issue Number: ref #58141
Problem Summary:
What changed and how does it work?
info schema V2 only store one copy of schema object in memory, so read/write need to lock, if we read too much and takes too long, it affects write, i.e. schema reloading during DDL execution, we can mitigate this by using finer-grained lock, but we cannot avoid it completely with current strategy. so in lightning, we remove related queries, and avoid create table twice by
IF NOT EXIST
, and check table existence on error bySHOW CREATE TABLE
, to make schema import part fasterwe also found that the query to
information_schema.tables
is getting slower over time, and cause lightning dispatch jobs slower, we can fix it too by replace the query.Check List
Tests
import 100K DB and total 200K tables, time reduced from 55m27 -> 19m20
before
after
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.