-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
docs: RFC for keyspace #39685
docs: RFC for keyspace #39685
Conversation
Signed-off-by: ystaticy <y_static_y@sina.com>
[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 The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
Signed-off-by: ystaticy <y_static_y@sina.com>
Signed-off-by: iosmanthus <myosmanthustree@gmail.com>
Add client-go and coprocessor section
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #39685 +/- ##
================================================
+ Coverage 72.4329% 81.2399% +8.8069%
================================================
Files 1491 2638 +1147
Lines 428997 717923 +288926
================================================
+ Hits 310735 583240 +272505
- Misses 99002 111483 +12481
- Partials 19260 23200 +3940 |
Signed-off-by: y_static_y@sina.com <y_static_y@sina.com>
Signed-off-by: y_static_y@sina.com <y_static_y@sina.com>
Signed-off-by: y_static_y@sina.com <y_static_y@sina.com>
Signed-off-by: y_static_y@sina.com <y_static_y@sina.com>
Signed-off-by: y_static_y@sina.com <y_static_y@sina.com>
Signed-off-by: y_static_y@sina.com <y_static_y@sina.com>
@AmoebaProtozoa: adding LGTM is restricted to approvers and reviewers in OWNERS files. In response to this: 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. |
Signed-off-by: y_static_y@sina.com <y_static_y@sina.com>
Signed-off-by: y_static_y@sina.com <y_static_y@sina.com>
|
||
### PD | ||
|
||
PD is responsible for managing `Keyspace` metadata. It provides HTTP and RPC interfaces to create, load, and modify `Keyspace` metadata. All other components retrieve the keyspace metadata from PD. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please add a raw list of the HTTP and RPC interfaces?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good, I added links to the two interfaces below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So users need to call the HTTP/RPC interfaces or use pd-ctl instead of SQL?
[**Keyspace Meta**](https://github.com/pingcap/kvproto/blob/d9297553c9009f569eaf4350f68a908f7811ee55/proto/keyspacepb.proto#L26C1-L33C2) is built when a keyspace is created, and the keyspace management interface operates on this metadata. The keyspace state in the metadata changes according to the keyspace state machine. The state change logic is as follows: | ||
![keyspace-state-machine.png](imgs%2Fkeyspace-state-machine.png) | ||
|
||
### TiDB |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be great if you can describe some plans about the observability(metrics, Grafana...) here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I've added the relevant descriptions below. PTAL~
Signed-off-by: y_static_y@sina.com <y_static_y@sina.com>
Signed-off-by: y_static_y@sina.com <y_static_y@sina.com>
Signed-off-by: y_static_y@sina.com <y_static_y@sina.com>
Signed-off-by: y_static_y@sina.com <y_static_y@sina.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
||
### PD | ||
|
||
PD is responsible for managing `Keyspace` metadata. It provides HTTP and RPC interfaces to create, load, and modify `Keyspace` metadata. All other components retrieve the keyspace metadata from PD. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So users need to call the HTTP/RPC interfaces or use pd-ctl instead of SQL?
- The default GC management type for a keyspace is global GC. | ||
2. Keyspace Level GC: | ||
- Indicates that the keyspace will advance its own GC safe point. | ||
- `Keyspace` GC related data includes: minimum start timestamp, GC safe point, and service safe point, which are stored in the dedicated path of each keyspace in PD. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can the GC parameters (e.g. tidb_gc_life_time) by set by each tenant separately? If so, by what kind of interface? HTTP/RPC?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can the GC parameters (e.g. tidb_gc_life_time) by set by each tenant separately? If so, by what kind of interface? HTTP/RPC?
Keyspace users can set tidb_gc_life_time directly using the SET SQL command just as before. This is because the system variables for each keyspace user are isolated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the keyspace scenario, all SQL operations remain the same as without a configured keyspace.
|
It's fine for serverless, but it's not friendly to end users IMO. Why can't you connect to any TiDB? |
An active TiDB instance is either in a Null Keyspace or configured with a specific keyspace. However, we should not create new keyspaces through any existing keyspace, as no keyspace has a 'manager' or higher-level status. @baiyuqing What are your thoughts on this question? |
Keyspace is aim to introduce ability to provide tenant-isolated space on single TiKV, different tenant's TiDB is invisible to eatch other. All keyspaces are basically equal, without hierarchy design. This doc is mainly about it. In the real-world, people is able to leverage keyspace mechanism to build multi-tenant db system on single TiKV cluster and hierarchical feature by existing http/grpc interface. SQL is easy to use indeed in most cases. However to provide SQL approach needs another new design and investigation. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: AmoebaProtozoa, baiyuqing, bb7133, djshow832 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 |
LGTM |
@ystaticy: The following tests failed, say
Full PR test history. Your PR dashboard. 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. I understand the commands that are listed here. |
Signed-off-by: ystaticy y_static_y@sina.com
What problem does this PR solve?
Issue Number: ref #40425
Problem Summary:
What is changed and how it works?
Check List
Tests
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.