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

support keyspace feature #7039

Closed
wants to merge 35 commits into from
Closed

Conversation

iosmanthus
Copy link
Contributor

Signed-off-by: iosmanthus [email protected]

What problem does this PR solve?

Issue Number: close #6815
Original pull request: #6816

Problem Summary:
Deps:

What is changed and how it works?

This pull request separates each keyspace's db/tables by rewriting their name with a keyspace prefix.
For example, table 1 in keyspace 2 is stored in a directory named: ks_2_t_1, and the same as the schema SQL file.

The keyspace's information is decoded from the region range in the writing process, and from gRPC requests context in the reading process. Every time TiFlash syncSchema, it needs a keyspace id parameter. The persistent schema will also contain the keyspace id in case of restarting the server.

This pull request also introduces a new config named api-version, whose default value is 1 meaning the node is working in the legacy mode. In this mode, schema info will be fetched in the bootstrap stage. If the api-version is 2, then the node is working in the keyspace mode, which will fetch schema lazily.

The pull request does not support the PageStoreV3 format and needs to be tested in V2 for now. In the future, the pull request should be compatible with the UniversalPageStore feature.

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 behaviours
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

support keyspace feature

iosmanthus and others added 30 commits February 14, 2023 11:35
Signed-off-by: iosmanthus <[email protected]>
Signed-off-by: iosmanthus <[email protected]>
1. refine some log messages, add a child logger with keyspace id info
2. add some comments for ManagedStorages's interfaces

Signed-off-by: iosmanthus <[email protected]>
Signed-off-by: JaySon-Huang <[email protected]>
Signed-off-by: JaySon-Huang <[email protected]>
1. move api_version for TiFlashStorageConfig
2. refine comments for TMTStorages

Signed-off-by: iosmanthus <[email protected]>
Signed-off-by: iosmanthus <[email protected]>
@ti-chi-bot
Copy link
Member

[REVIEW NOTIFICATION]

This pull request has not been approved.

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 release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Mar 10, 2023
@iosmanthus iosmanthus closed this Mar 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TiFlash support keyspace
4 participants