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

*: add table storage info status api #22859

Merged
merged 11 commits into from
Jul 19, 2021

Conversation

jianzhiyao
Copy link
Contributor

@jianzhiyao jianzhiyao commented Feb 21, 2021

What problem does this PR solve?

Issue Number: close #4989

Problem Summary:
Add table storage infomation to status api.

What is changed and how it works?

Proposal: #4989

What's Changed:
new status api: http://127.0.0.1:10080/schema_storage

How it Works:
By querying INFORMATION_SCHEMA.TABLES.

Check List

Tests

  • Unit test

Side effects

  • Performance regression
    • Consumes more CPU
    • Consumes more MEM

Release note

  • add table storage info status api

@ti-srebot ti-srebot added the first-time-contributor Indicates that the PR was contributed by an external member and is a first-time contributor. label Feb 21, 2021
@sre-bot
Copy link
Contributor

sre-bot commented Feb 21, 2021

@github-actions github-actions bot added the sig/sql-infra SIG: SQL Infra label Feb 21, 2021
@ti-chi-bot ti-chi-bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed sig/infra labels Feb 22, 2021
@jianzhiyao jianzhiyao force-pushed the frt/support_4989 branch 3 times, most recently from de31363 to f363b81 Compare February 23, 2021 09:13
@jianzhiyao jianzhiyao changed the title WIP: Frt/support 4989 *: add table storage info status api Feb 23, 2021
@ti-chi-bot ti-chi-bot requested a review from hicqu March 4, 2021 09:53
@jianzhiyao
Copy link
Contributor Author

/cc @AilinKid @AndreMouche

Copy link
Contributor

@AndreMouche AndreMouche left a comment

Choose a reason for hiding this comment

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

The logic LGTM, while I wish you could make this PR more friendly to the reviewers and maintainers, Please make the code as easy as possible, for example, it is a good habit if the number of '{..{..{..}}}' less than 3.

if s, err = session.CreateSession(h.Store); err != nil {
return
}
if s != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

it seems we do not need to do anything when s is nil, could we process this situation before, so we needn't always remember this situation until the end of the function.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

}
if s != nil {
defer s.Close()
if ctx, ok := s.(sessionctx.Context); ok {
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto, less {}, return as early as possible.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@ti-chi-bot ti-chi-bot added status/LGT1 Indicates that a PR has LGTM 1. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Jun 2, 2021
@jianzhiyao
Copy link
Contributor Author

/run-build

Copy link
Contributor

@AndreMouche AndreMouche left a comment

Choose a reason for hiding this comment

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

LGTM

@jianzhiyao
Copy link
Contributor Author

PTAL @morgo

@morgo morgo requested review from morgo and removed request for hicqu June 3, 2021 16:00
@ti-chi-bot
Copy link
Member

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • AndreMouche
  • morgo

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 status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Jun 3, 2021
@morgo
Copy link
Contributor

morgo commented Jun 3, 2021

/merge

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Jun 3, 2021
@xhebox
Copy link
Contributor

xhebox commented Jun 28, 2021

TelemetryRotateWindowLoop stuck the termination of the test. So yes, the test actually passed. But I can not reproduce the case on my laptop. Investigating the root cause...

@xhebox
Copy link
Contributor

xhebox commented Jun 29, 2021

/run-unit-test

1 similar comment
@xhebox
Copy link
Contributor

xhebox commented Jun 29, 2021

/run-unit-test

@xhebox
Copy link
Contributor

xhebox commented Jun 29, 2021

/merge

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Jun 29, 2021
@xhebox
Copy link
Contributor

xhebox commented Jun 29, 2021

/merge cancel

@ti-chi-bot ti-chi-bot removed the status/can-merge Indicates a PR has been approved by a committer. label Jun 29, 2021
jianzhiyao and others added 8 commits July 19, 2021 12:36
Signed-off-by: xhe <xw897002528@gmail.com>
Signed-off-by: xhe <xw897002528@gmail.com>
Signed-off-by: xhe <xw897002528@gmail.com>
Signed-off-by: xhe <xw897002528@gmail.com>
Signed-off-by: xhe <xw897002528@gmail.com>
Signed-off-by: xhe <xw897002528@gmail.com>
Signed-off-by: xhe <xw897002528@gmail.com>
@xhebox
Copy link
Contributor

xhebox commented Jul 19, 2021

/merge

@ti-chi-bot
Copy link
Member

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

Commit hash: aae2fba

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Jul 19, 2021
@ti-chi-bot
Copy link
Member

@jianzhiyao: Your PR was out of date, I have automatically updated it for you.

At the same time I will also trigger all tests for you:

/run-all-tests

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.

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.

@xhebox
Copy link
Contributor

xhebox commented Jul 19, 2021

/run-all-tests

1 similar comment
@xhebox
Copy link
Contributor

xhebox commented Jul 19, 2021

/run-all-tests

@xhebox
Copy link
Contributor

xhebox commented Jul 19, 2021

/merge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
first-time-contributor Indicates that the PR was contributed by an external member and is a first-time contributor. sig/sql-infra SIG: SQL Infra size/L Denotes a PR that changes 100-499 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.

HTTP status API should show table storage size
10 participants