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

storage: Add keyspace_id to DT system tables #9371

Merged

Conversation

Lloyd-Pottiger
Copy link
Contributor

What problem does this PR solve?

Issue Number: ref #9032

Problem Summary:

What is changed and how it works?

Add a keyspace_id field, so that TiDB could query TiFlash system tables over it.

mapper.displayDatabaseName is used in some other places so that it is unchanged.

TiFlash :) select * from dt_segments where keyspace_id=4

SELECT *
FROM dt_segments
WHERE keyspace_id = 4

Ok.

0 rows in set. Elapsed: 0.107 sec.

TiFlash :) select * from dt_segments where keyspace_id=1

SELECT *
FROM dt_segments
WHERE keyspace_id = 1

┌─database──┬─table─────┬─tidb_database─┬─tidb_table─┬─keyspace_id─┬─table_id─┬─is_tombstone─┬─segment_id─┬─range──────────────────────────────────────┬─epoch─┬──rows─┬──────size─┬─delta_rate─┬─delta_memtable_rows─┬─delta_memtable_size─┬─delta_memtable_column_files─┬─delta_memtable_delete_ranges─┬─delta_persisted_page_id─┬─delta_persisted_rows─┬─delta_persisted_size─┬─delta_persisted_column_files─┬─delta_persisted_delete_ranges─┬─delta_cache_size─┬─delta_index_size─┬─stable_page_id─┬─stable_rows─┬─stable_size─┬─stable_dmfiles─┬─stable_dmfiles_id_0─┬─stable_dmfiles_rows─┬─stable_dmfiles_size─┬─stable_dmfiles_size_on_disk─┬─stable_dmfiles_packs─┐
│ ks_1_db_2 │ ks_1_t_96 │ test          │ sample     │           1 │       96 │            0 │          1 │ [-9223372036854775808,9223372036854775807) │     5 │ 60000 │ 189900000 │          0 │                   0 │                   0 │                           0 │                            0 │                      42 │                    0 │                    0 │                            0 │                             0 │                0 │             2032 │             43 │       60000 │   189900000 │              1 │                 105 │               60000 │           189900000 │                    53891161 │                    8 │
└───────────┴───────────┴───────────────┴────────────┴─────────────┴──────────┴──────────────┴────────────┴────────────────────────────────────────────┴───────┴───────┴───────────┴────────────┴─────────────────────┴─────────────────────┴─────────────────────────────┴──────────────────────────────┴─────────────────────────┴──────────────────────┴──────────────────────┴──────────────────────────────┴───────────────────────────────┴──────────────────┴──────────────────┴────────────────┴─────────────┴─────────────┴────────────────┴─────────────────────┴─────────────────────┴─────────────────────┴─────────────────────────────┴──────────────────────┘

1 rows in set. Elapsed: 0.006 sec.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

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

None

@ti-chi-bot ti-chi-bot bot added release-note-none Denotes a PR that doesn't merit a release note. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Aug 26, 2024
Copy link
Contributor

@JaySon-Huang JaySon-Huang 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 ti-chi-bot bot added approved needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Aug 27, 2024
Copy link
Contributor

ti-chi-bot bot commented Aug 27, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: breezewish, JaySon-Huang

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:
  • OWNERS [JaySon-Huang,breezewish]

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 Aug 27, 2024
Copy link
Contributor

ti-chi-bot bot commented Aug 27, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-08-27 01:47:21.088187042 +0000 UTC m=+834836.222637163: ☑️ agreed by JaySon-Huang.
  • 2024-08-27 02:27:42.993371271 +0000 UTC m=+837258.127821389: ☑️ agreed by breezewish.

@Lloyd-Pottiger
Copy link
Contributor Author

/retest

@ti-chi-bot ti-chi-bot bot merged commit d113404 into pingcap:master Aug 27, 2024
5 checks passed
@Lloyd-Pottiger Lloyd-Pottiger deleted the add-keyspace-id-system-table branch August 28, 2024 02:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm release-note-none Denotes a PR that doesn't merit a release note. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants