From d0f481c8bcec1eb0f5f46b9e326fd9e59a2b0b5e Mon Sep 17 00:00:00 2001 From: guo-shaoge Date: Wed, 31 May 2023 12:02:41 +0800 Subject: [PATCH] update client-c to support choosing non pending peer when dispatch task (#7574) close pingcap/tiflash#7301 --- contrib/client-c | 2 +- contrib/kvproto | 2 +- .../Storages/StorageDisaggregatedRemote.cpp | 22 ------------------- dbms/src/Storages/Transaction/FastAddPeer.cpp | 3 ++- 4 files changed, 4 insertions(+), 25 deletions(-) diff --git a/contrib/client-c b/contrib/client-c index a8cd3d5b3f3..5104ea8fb26 160000 --- a/contrib/client-c +++ b/contrib/client-c @@ -1 +1 @@ -Subproject commit a8cd3d5b3f365c49a3c160c6fda84012193d0c31 +Subproject commit 5104ea8fb26d58e770d96db43342fb7c06fd8ff1 diff --git a/contrib/kvproto b/contrib/kvproto index e166ae58810..c13fc8b65f7 160000 --- a/contrib/kvproto +++ b/contrib/kvproto @@ -1 +1 @@ -Subproject commit e166ae588106b9deef7cc399a7e73f325361c0d2 +Subproject commit c13fc8b65f75592c4c4d19f8b26b9c1ccf067c5a diff --git a/dbms/src/Storages/StorageDisaggregatedRemote.cpp b/dbms/src/Storages/StorageDisaggregatedRemote.cpp index 9fee1703132..aa3c5d6a33c 100644 --- a/dbms/src/Storages/StorageDisaggregatedRemote.cpp +++ b/dbms/src/Storages/StorageDisaggregatedRemote.cpp @@ -61,28 +61,6 @@ #include #include -namespace pingcap::kv -{ -// The rpc trait -template <> -struct RpcTypeTraits -{ - using RequestType = disaggregated::EstablishDisaggTaskRequest; - using ResultType = disaggregated::EstablishDisaggTaskResponse; - - static const char * err_msg() { return "EstablishDisaggTask Failed"; } // NOLINT(readability-identifier-naming) - - static ::grpc::Status doRPCCall( - grpc::ClientContext * context, - std::shared_ptr client, - const RequestType & req, - ResultType * res) - { - return client->stub->EstablishDisaggTask(context, req, res); - } -}; -} // namespace pingcap::kv - namespace DB { diff --git a/dbms/src/Storages/Transaction/FastAddPeer.cpp b/dbms/src/Storages/Transaction/FastAddPeer.cpp index ca5181b80fb..891626aaf99 100644 --- a/dbms/src/Storages/Transaction/FastAddPeer.cpp +++ b/dbms/src/Storages/Transaction/FastAddPeer.cpp @@ -128,7 +128,8 @@ FastAddPeerRes genFastAddPeerRes(FastAddPeerStatus status, std::string && apply_ std::vector getCandidateStoreIDsForRegion(TMTContext & tmt_context, UInt64 region_id, UInt64 current_store_id) { auto pd_client = tmt_context.getPDClient(); - auto [region, _] = pd_client->getRegionByID(region_id); + auto resp = pd_client->getRegionByID(region_id); + const auto & region = resp.region(); std::vector store_ids; store_ids.reserve(region.peers_size()); for (const auto & peer : region.peers())