Question about PD grpc interface

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: 请问PDgrpc接口的问题

| username: 我家有个臭皮崽

What is the difference in semantics between the following two gRPC interfaces in PD:
rpc AskBatchSplit(AskBatchSplitRequest) returns (AskBatchSplitResponse) {}
rpc ReportBatchSplit(ReportBatchSplitRequest) returns (ReportBatchSplitResponse) {}
If I use SplitAndScatterRegions for splitting, and the returned result is:
message SplitAndScatterRegionsResponse {
ResponseHeader header = 1;
uint64 split_finished_percentage = 2;
uint64 scatter_finished_percentage = 3;
repeated uint64 regions_id = 4;
}
indicating that the split is not completed or the scatter is not completed, which interface should I call to wait for completion?

| username: TiDBer_jYQINSnf | Original post link

Why do I find that this function is not implemented everywhere?

func (s *Server) SplitAndScatterRegions(context context.Context, r *pdpb.SplitAndScatterRegionsRequest) (*pdpb.SplitAndScatterRegionsResponse, error) {
    return nil, errors.New("not implemented")
}

If yours is implemented, just take a look at the PD code.

| username: 我家有个臭皮崽 | Original post link

I see that the latest version has implemented the SplitAndScatterRegions feature, but if this function returns uint64 split_finished_percentage = 2; uint64 scatter_finished_percentage = 3; which function should I call to wait for the status if these two values are not 100?

| username: TiDBer_jYQINSnf | Original post link

I looked at a few MRs. There is no query interface inside.
Referencing the code of SplitAndScatterRegions, you can continuously obtain the regions to be adjusted and then determine whether they meet the expectations.
As for whether there is an interface to query this, I haven’t seen it yet. You can look for it. It’s all Go code, nothing complicated.

| username: system | Original post link

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.