Skip to content
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

executor: optimize the get snapshot table meta for tiflash/replica HTTP API #17969

Merged
merged 6 commits into from
Jun 12, 2020

Conversation

crazycs520
Copy link
Contributor

Signed-off-by: crazycs520 crazycs520@gmail.com

What problem does this PR solve?

backaground

/tiflash/replica HTTP API needs to read the dropped or truncated table information with snapshot.

Before this PR, TiDB will use GetSnapshotInfoSchema to generate a snapshot information schema, then read the dropped or truncated table from this snapshot information.

The problem is, if there are too many dropped/truncated DDL history jobs, and the GC life is too long, then query /tiflash/replica HTTP API will be very slow, the most of time is spent on the generate many snapshot information schema.

This PR just use the schema ID and table ID to load the table information with snapshot, avoid the expensive generated snapshot information schema process.

Related changes

  • Need to cherry-pick to the release branch

Check List

Tests

  • Manual test

Side effects

  • No

Release note

  • optimize the get snapshot table meta for tiflash/replica HTTP API.

…TP API

Signed-off-by: crazycs520 <crazycs520@gmail.com>
@crazycs520 crazycs520 added type/enhancement The issue or PR belongs to an enhancement. sig/execution SIG execution sig/sql-infra SIG: SQL Infra labels Jun 11, 2020
Copy link
Contributor

@zimulala zimulala left a comment

Choose a reason for hiding this comment

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

LGTM

@zimulala zimulala added the status/LGT1 Indicates that a PR has LGTM 1. label Jun 12, 2020
Copy link
Contributor

@tangenta tangenta left a comment

Choose a reason for hiding this comment

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

LGTM

@tangenta tangenta added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Jun 12, 2020
@crazycs520
Copy link
Contributor Author

/run-all-tests

@codecov
Copy link

codecov bot commented Jun 12, 2020

Codecov Report

Merging #17969 into master will not change coverage.
The diff coverage is n/a.

@@             Coverage Diff             @@
##             master     #17969   +/-   ##
===========================================
  Coverage   79.4551%   79.4551%           
===========================================
  Files           524        524           
  Lines        142065     142065           
===========================================
  Hits         112878     112878           
  Misses        20059      20059           
  Partials       9128       9128           

@crazycs520
Copy link
Contributor Author

/run-all-tests

Copy link
Contributor

@AilinKid AilinKid left a comment

Choose a reason for hiding this comment

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

LGTM

@crazycs520 crazycs520 merged commit 3895619 into pingcap:master Jun 12, 2020
ti-srebot pushed a commit to ti-srebot/tidb that referenced this pull request Jun 23, 2020
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
@ti-srebot
Copy link
Contributor

cherry pick to release-3.1 in PR #18183

ti-srebot pushed a commit to ti-srebot/tidb that referenced this pull request Jun 23, 2020
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
@ti-srebot
Copy link
Contributor

cherry pick to release-4.0 in PR #18184

ti-srebot added a commit that referenced this pull request Jul 7, 2020
…TP API (#17969) (#18184)

Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sig/execution SIG execution sig/sql-infra SIG: SQL Infra status/LGT2 Indicates that a PR has LGTM 2. type/enhancement The issue or PR belongs to an enhancement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants