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

inforschema, executor, util/kvcache, util/statement_summary : Add STATEMENTS_SUMMARY_EVICTED into information_schema (#24513) #25295

Closed

Conversation

ti-srebot
Copy link
Contributor

@ti-srebot ti-srebot commented Jun 9, 2021

cherry-pick #24513 to release-5.0
You can switch your code base to this Pull Request by using git-extras:

# In tidb repo:
git pr https://github.com/pingcap/tidb/pull/25295

After apply modifications, you can push your change to this PR via:

git push git@github.com:ti-srebot/tidb.git pr/25295:release-5.0-0367c54698b4

What problem does this PR solve?

Issue Number: close #23920

Problem Summary:

What is changed and how it works?

What's Changed:

  • inforschema/tables.go
  • executor/inforschema_reader.go
  • executor/builder.go
  • util/kvcache/simple_lru.go
  • Add util/stmtsummary/evicted.go

How it Works:

  1. Get evicted digests by editing statementSummaryMap's onEvict function
  2. Adding evicted digest elements to corresponding record in ssMap's other list.
  3. register table to information schema.

Related changes

  • Need to cherry-pick to the release branch

Check List

Tests

  • Tests will be added as soon as possible.

Side effects

  • Performance regression
    • Consumes more CPU
    • Consumes more MEM
  • Breaking backward compatibility

Release note

Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
@ti-srebot ti-srebot requested a review from a team as a code owner June 9, 2021 07:56
@ti-srebot ti-srebot requested review from lzmhhh123 and removed request for a team June 9, 2021 07:56
@ti-chi-bot
Copy link
Member

@ti-srebot: This cherry pick PR is for a release branch and has not yet been approved by release team.
Adding the do-not-merge/cherry-pick-not-approved label.

To merge this cherry pick, it must first be approved by the collaborators.

AFTER it has been approved by collaborators, please ping the release team in a comment to request a cherry pick review.

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.

@ti-srebot
Copy link
Contributor Author

/run-all-tests

@ti-srebot
Copy link
Contributor Author

@ClSlaid please accept the invitation then you can push to the cherry-pick pull requests.
https://github.com/ti-srebot/tidb/invitations

@ClSlaid
Copy link
Contributor

ClSlaid commented Jun 9, 2021

@breeswish PTAL
this PR should be merged after #25299

Signed-off-by: ClSlaid <cailue@bupt.edu.cn>
@ClSlaid
Copy link
Contributor

ClSlaid commented Jun 11, 2021

@breeswish PTAL.

@crazycs520
Copy link
Contributor

/run-all-tests

Copy link
Contributor

@crazycs520 crazycs520 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
Copy link
Member

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • crazycs520

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 submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Jun 15, 2021
@ClSlaid
Copy link
Contributor

ClSlaid commented Jul 1, 2021

/run-all-tests

@ClSlaid
Copy link
Contributor

ClSlaid commented Jul 5, 2021

@breeswish PTAL

@ClSlaid
Copy link
Contributor

ClSlaid commented Jul 6, 2021

/run-all-tests

@ClSlaid
Copy link
Contributor

ClSlaid commented Jul 6, 2021

/run-unit-test

@breezewish
Copy link
Member

Please perform a benchmark and post results here. The rest LGTM.

@ClSlaid
Copy link
Contributor

ClSlaid commented Jul 8, 2021

Please perform a benchmark and post results here. The rest LGTM.

Bench Marks

TiDB Without Evict Table Without Evict Table With Evict Table With Evict Table
Statements Summary Table Size 1 3000 1 3000
Average QPS
(oltp_point_select)
22910.10 40765.21 23256.88 39769.23
Average QPS
(oltp_read_only)
12166.70 16063.00 11953.82 16017.22

Git Hash:

Bench Environment

  • Machine:

    Instance Alpha Bravo
    Operating System Cent OS 7.6 Cent OS 7.6
    CPU Cores 8 8
    RAM Size 16 GB 16 GB
    Storage Type HDD HDD
  • Cluster Version: v5.0.0

  • PD: on Alpha

  • TiKV: on Alpha

  • DashBoard: on Alpha

  • Grafana: on Alpha

  • TiDB: on Bravo

How did the bench made

Generate Data

Generate Data with SysBench, by executing:

sysbench --config-file=config oltp_point_select --tables=32 --table-size=1000000 prepare

set thread used for SysBench to 128 threads, set test time to 600 seconds.

#sysbench config file
mysql-host=<IP address of bravo>
mysql-port=4000
mysql-user=root
mysql-db=sbtest
time=600
threads=128
report-interval=10
db-driver=mysql

Run Point Select bench by executing:

sysbench --config-file=config oltp_point_select --tables=32 --table-size=1000000 run

Run Read-Only bench (a benchmark containing multiple kinds of database query) by executing:

sysbench --config-file=config oltp_read_only --tables=32 --table-size=1000000 run

@ClSlaid
Copy link
Contributor

ClSlaid commented Jul 22, 2021

/cc @djshow832
PTAL

@djshow832
Copy link
Contributor

Won't be cherry-picked to 5.0.

@djshow832 djshow832 closed this Aug 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do-not-merge/cherry-pick-not-approved sig/execution SIG execution sig/sql-infra SIG: SQL Infra size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. status/LGT1 Indicates that a PR has LGTM 1. type/5.0-cherry-pick
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants