Skip to content

executor/infoschema_reader: exclude virtual schema in TIKV_REGION_STATUS #61068

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

Conversation

sriramrajendiran
Copy link
Contributor

@sriramrajendiran sriramrajendiran commented May 10, 2025

What problem does this PR solve?

Issue Number: close #59698

Problem Summary:

What changed and how does it work?

Add a check to exclude INFORMATION_SCHEMA, METRICS_SCHEMA and PERFORMANCE_SCHEMA when TIKV_REGION_STATUS is queried.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No need to test
    • I checked and no code files have been changed.

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

Please refer to Release Notes Language Style Guide to write a quality release note.

Previously, when you query TIKV_REGION_STATUS, results will show tables from INFORMATION_SCHEMA, METRICS_SCHEMA and PERFORMANCE_SCHEMA. From now on, it will not be shown as a part of this TIKV_REGION_STATUS results as they are not a part of TiKV data store.

@ti-chi-bot ti-chi-bot bot added do-not-merge/needs-tests-checked release-note-none Denotes a PR that doesn't merit a release note. needs-ok-to-test Indicates a PR created by contributors and need ORG member send '/ok-to-test' to start testing. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels May 10, 2025
Copy link

ti-chi-bot bot commented May 10, 2025

Welcome @sriramrajendiran!

It looks like this is your first PR to pingcap/tidb 🎉.

I'm the bot to help you request reviewers, add labels and more, See available commands.

We want to make sure your contribution gets all the attention it needs!



Thank you, and welcome to pingcap/tidb. 😃

Copy link

ti-chi-bot bot commented May 10, 2025

Hi @sriramrajendiran. Thanks for your PR.

I'm waiting for a pingcap member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

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.

Copy link

tiprow bot commented May 10, 2025

Hi @sriramrajendiran. Thanks for your PR.

PRs from untrusted users cannot be marked as trusted with /ok-to-test in this repo meaning untrusted PR authors can never trigger tests themselves. Collaborators can still trigger tests on the PR using /test all.

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.

@ti-chi-bot ti-chi-bot bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed do-not-merge/needs-tests-checked release-note-none Denotes a PR that doesn't merit a release note. labels May 10, 2025
@lance6716
Copy link
Contributor

/ok-to-test

@ti-chi-bot ti-chi-bot bot added ok-to-test Indicates a PR is ready to be tested. and removed needs-ok-to-test Indicates a PR created by contributors and need ORG member send '/ok-to-test' to start testing. labels May 12, 2025
@lance6716 lance6716 requested a review from Copilot May 12, 2025 01:23
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates the TiKV region status query to exclude virtual schemas from the results. Key changes include:

  • Adding a check to skip regions from INFORMATION_SCHEMA, METRICS_SCHEMA, and PERFORMANCE_SCHEMA.
  • Updating unit tests to verify that virtual schemas are properly excluded.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
pkg/executor/infoschema_reader.go Added conditional exclusion of virtual schemas in the TiKV region status query.
pkg/executor/infoschema_cluster_table_test.go Added a unit test to verify that virtual schemas are excluded from the query results.

Copy link

codecov bot commented May 12, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 73.5003%. Comparing base (2503d50) to head (9546639).
Report is 16 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #61068        +/-   ##
================================================
+ Coverage   73.1498%   73.5003%   +0.3505%     
================================================
  Files          1724       1724                
  Lines        477078     480192      +3114     
================================================
+ Hits         348982     352943      +3961     
+ Misses       106697     105805       -892     
- Partials      21399      21444        +45     
Flag Coverage Δ
integration 42.7583% <0.0000%> (?)
unit 72.3931% <100.0000%> (+0.0356%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
dumpling 52.7804% <ø> (ø)
parser ∅ <ø> (∅)
br 46.7651% <ø> (-0.7873%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ti-chi-bot ti-chi-bot bot added approved needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels May 12, 2025
@lance6716
Copy link
Contributor

/cc @tangenta

@ti-chi-bot ti-chi-bot bot requested a review from tangenta May 13, 2025 02:59
for i := range allRegionsInfo.Regions {
regionTableList := tableInfos[allRegionsInfo.Regions[i].ID]
if len(regionTableList) == 0 {
e.setNewTiKVRegionStatusCol(&allRegionsInfo.Regions[i], nil)
}
for j, regionTable := range regionTableList {
// Exclude virtual schemas
if slices.Contains(virtualSchemas, regionTable.DB.Name.L) {
Copy link
Contributor

Choose a reason for hiding this comment

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

you can use util.IsMemDB function.

@sriramrajendiran
Copy link
Contributor Author

/retest

Copy link

ti-chi-bot bot commented May 14, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: lance6716, tangenta

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels May 14, 2025
Copy link

ti-chi-bot bot commented May 14, 2025

[LGTM Timeline notifier]

Timeline:

  • 2025-05-12 13:53:04.288544817 +0000 UTC m=+366850.436506035: ☑️ agreed by lance6716.
  • 2025-05-14 06:28:11.17294149 +0000 UTC m=+512957.320902706: ☑️ agreed by tangenta.

@ti-chi-bot ti-chi-bot bot merged commit cf1a424 into pingcap:master May 14, 2025
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm ok-to-test Indicates a PR is ready to be tested. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

query TIKV_REGION_STATUS table returns unexpected result
4 participants