Hello Tidy Bot, Alexey Serbin, Kudu Jenkins, Adar Dembo, Hao Hao,

I'd like you to reexamine a change. Please visit

    http://gerrit.cloudera.org:8080/12002

to look at the new patch set (#7).

Change subject: KUDU-683: unify C++ client-to-master retry logic
......................................................................

KUDU-683: unify C++ client-to-master retry logic

In preparation for implementing an asynchronous RPC that will need to
connect to the leader master, I've been looking through some of the
retry logic we have scattered around the C++ client. I noticed
near-identical code in a couple places (LookupRpc and
SyncLeaderMasterRpc), so I've ripped it out and put it in its own
reusable class.

A few things are bundled into this patch. The big pieces are:
- A new AsyncLeaderMasterRpc template class is introduced that sends
  RPCs to the leader master and handles reconnection and retries upon
  failure. LookupRpcs will now use this template to perform their RPCs,
  and SyncLeaderMasterRpcs has been replaced entirely to use a
  synchronized AsyncLeaderMasterRpcs.
- In implementing the template, I unified the retry logic to be used for
  the above existing RPCs; the bulk of it was overlapped, but some logic
  existed specifically for LookupRpc. See the comment above
  RetryOrReconnectIfNecessary in master_proxy_rpc.h and the impl for
  LookupRpc::SendRpcCb in meta_cache.cc for more details. For the most
  part, there aren't functional changes.
- SyncLeaderMasterRpcs used exponential backoff when retrying RPCs, but
  the existing RpcRetrier implemented its own backoff. To maintain
  this, I've piped down an enum from Rpc to RpcRetrier to determine
  which backoff strategy to use.
- The new template and most other existing Rpc implementations
  duplicated code from Rpc::HandleResponse() to handle certain remote
  errors. As such, I've removed HandleResponse entirely and added a TODO
  to perhaps merge existing logic even further (see retriable_rpc.h).

Change-Id: I2450676da1c723a247c84deb1b895f116173670e
---
M src/kudu/client/CMakeLists.txt
M src/kudu/client/client-internal.cc
M src/kudu/client/client-internal.h
M src/kudu/client/client-test.cc
M src/kudu/client/client.cc
M src/kudu/client/client.h
A src/kudu/client/master_proxy_rpc.cc
A src/kudu/client/master_proxy_rpc.h
M src/kudu/client/master_rpc.cc
M src/kudu/client/meta_cache.cc
M src/kudu/client/scanner-internal.cc
M src/kudu/integration-tests/master-stress-test.cc
M src/kudu/integration-tests/replace_tablet-itest.cc
M src/kudu/integration-tests/security-unknown-tsk-itest.cc
M src/kudu/rpc/retriable_rpc.h
M src/kudu/rpc/rpc.cc
M src/kudu/rpc/rpc.h
M src/kudu/tools/tool_action_common.cc
M src/kudu/tools/tool_action_common.h
M src/kudu/tools/tool_action_master.cc
M src/kudu/tools/tool_action_tablet.cc
M src/kudu/tools/tool_action_tserver.cc
22 files changed, 740 insertions(+), 574 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/02/12002/7
--
To view, visit http://gerrit.cloudera.org:8080/12002
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I2450676da1c723a247c84deb1b895f116173670e
Gerrit-Change-Number: 12002
Gerrit-PatchSet: 7
Gerrit-Owner: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Adar Dembo <a...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <aser...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Hao Hao <hao....@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Tidy Bot (241)

Reply via email to