Skip to content

Commit

Permalink
update client-c to support choosing non pending peer when dispatch ta…
Browse files Browse the repository at this point in the history
…sk (#7574)

close #7301
  • Loading branch information
guo-shaoge authored May 31, 2023
1 parent 8dcb558 commit d0f481c
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 25 deletions.
22 changes: 0 additions & 22 deletions dbms/src/Storages/StorageDisaggregatedRemote.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,28 +61,6 @@
#include <atomic>
#include <numeric>

namespace pingcap::kv
{
// The rpc trait
template <>
struct RpcTypeTraits<disaggregated::EstablishDisaggTaskRequest>
{
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<KvConnClient> client,
const RequestType & req,
ResultType * res)
{
return client->stub->EstablishDisaggTask(context, req, res);
}
};
} // namespace pingcap::kv

namespace DB
{

Expand Down
3 changes: 2 additions & 1 deletion dbms/src/Storages/Transaction/FastAddPeer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@ FastAddPeerRes genFastAddPeerRes(FastAddPeerStatus status, std::string && apply_
std::vector<StoreID> 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<StoreID> store_ids;
store_ids.reserve(region.peers_size());
for (const auto & peer : region.peers())
Expand Down

0 comments on commit d0f481c

Please sign in to comment.