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

Define the independent (Tenant) TSO gRPC server #1053

Merged
merged 5 commits into from
Feb 16, 2023

Conversation

binshi-bing
Copy link
Contributor

@binshi-bing binshi-bing commented Feb 4, 2023

Issue Number: ref #5836

Signed-off-by: binshi-bing binshi.bing@gmail.com

Changes:

  1. Add keyspace id and keyspace_group_id to RequestHeader/Response Header to support multi-tenant.
  2. Define new XXXRequest/XXXResponse messages by reusing the messages in pdpb for better back-compatibility. The tenant tso protocol can also evolve independently by adding new rpcs and new messages.

@CLAassistant
Copy link

CLAassistant commented Feb 4, 2023

CLA assistant check
All committers have signed the CLA.

@binshi-bing
Copy link
Contributor Author

Issue Number: ref #5836

@disksing
Copy link
Contributor

disksing commented Feb 6, 2023

Hi @binshi-bing , you will have to sign the CLA before we can merge your PR.

proto/tsopb.proto Outdated Show resolved Hide resolved
@binshi-bing binshi-bing force-pushed the add-new-tso-service-in-protobuf branch from 12ab52f to 22ec660 Compare February 7, 2023 23:12
@binshi-bing binshi-bing marked this pull request as draft February 7, 2023 23:37
@binshi-bing binshi-bing force-pushed the add-new-tso-service-in-protobuf branch from 22ec660 to d88db97 Compare February 8, 2023 01:56
@binshi-bing binshi-bing marked this pull request as ready for review February 8, 2023 01:59
@binshi-bing binshi-bing changed the title Define an independent TSO gRPC server Define an independent (Tenant) TSO gRPC server Feb 8, 2023

message RequestHeader {
// tenant_id is the unique id of the tenant
TenantID tenant_id = 1;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thought about setting it to optional, but decided not to do so. Let me know if you have different options.

proto/tsopb.proto Outdated Show resolved Hide resolved
@binshi-bing binshi-bing force-pushed the add-new-tso-service-in-protobuf branch from 6af5a98 to efdbe41 Compare February 8, 2023 22:29
@binshi-bing binshi-bing changed the title Define an independent (Tenant) TSO gRPC server Define the independent (Tenant) TSO gRPC server Feb 9, 2023
@binshi-bing binshi-bing force-pushed the add-new-tso-service-in-protobuf branch 2 times, most recently from d62dad4 to d4c6f18 Compare February 9, 2023 21:48
binshi-bing added a commit to binshi-bing/pd that referenced this pull request Feb 12, 2023
Basic implement the indepent (Tenant) TSO gPRC service.
The kvproto pr is here pingcap/kvproto#1053

Signed-off-by: Bin Shi <binshi.bing@gmail.com>
binshi-bing added a commit to binshi-bing/pd that referenced this pull request Feb 13, 2023
Basic implement the indepent (Tenant) TSO gPRC service.
The kvproto pr is here pingcap/kvproto#1053

Signed-off-by: Bin Shi <binshi.bing@gmail.com>
Issue Number: ref #5836

Signed-off-by: binshi-bing <binshi.bing@gmail.com>
Signed-off-by: Bin Shi <binshi.bing@gmail.com>
…back-compatability

Signed-off-by: Bin Shi <binshi.bing@gmail.com>
@binshi-bing binshi-bing force-pushed the add-new-tso-service-in-protobuf branch from d4c6f18 to f67a08b Compare February 13, 2023 17:39
revert to option 1 mentioned in https://pingcap.feishu.cn/docx/K1kMdZaUmoeV7fxCH4jclmmtnTc for the following two reasons:
1. We mightn't want to support multi-tenant in the existing pdpb rpcs and messages.
2. No need to do the refactor mentioned in option 2 for now, as it isn't clear for how to refactor the tso related data structures and logic in the pkg/tso.
3. Minimize the change and refactor in server/grpc_server to avoid introducing bugs into PD path.

Signed-off-by: Bin Shi <binshi.bing@gmail.com>
… on tso data structures which use pdpb message type directly and need more refactor.

Signed-off-by: Bin Shi <binshi.bing@gmail.com>
@binshi-bing binshi-bing force-pushed the add-new-tso-service-in-protobuf branch from 174f4d4 to 990822e Compare February 15, 2023 19:07
@lhy1024 lhy1024 merged commit fe71e5d into pingcap:master Feb 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants