Michael Ho has uploaded a new change for review.

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

Change subject: KUDU-2065, KUDU-2011: Release sidecars on cancellation or 
timeout
......................................................................

KUDU-2065, KUDU-2011: Release sidecars on cancellation or timeout

Previously, when an outbound call times out, the RPC layer will
continue to send the entire payload (including any sidecars) to
the remote destination until the promised number of bytes specified
in the header are sent. This is problematic for the users of the
RPC layer as there is no well defined point in which the sidecars
are no longer referenced by the RPC layer. The only model in which
this would work is for the caller to either transfer or share ownership
of the sidecars with the RPC layer. This is not always desirable from
the caller's point of view for resource management.

This change fixes the problem above by modifying the RPC protocol
to allow an in-flight RPC call to be aborted. Specifically, a new
footer is added to all outbound call requests. It contains a flag,
when true, indicates the request was cancelled mid-flight and the
inbound call should be ignored altogether. This footer enables
the caller to relinquish references to the sidecars early when
an outbound call is cancelled or timed-out. Once the call is cancelled
or timed-out, the RPC layer will send the remainder of the bytes for
the request with some dummy bytes. Since the aborted flag is set in
the footer, the inbound call will be ignored anyway so it's okay to
send random bytes.

To accommodate the new footer, a new RPC feature flag HAS_FOOTER
is also introduced in this change.

Change-Id: I5c8e294090279649082eebc4f6cfb6fe858bbbfc
---
M docs/design-docs/rpc.md
M src/kudu/rpc/blocking_ops.cc
M src/kudu/rpc/connection.cc
M src/kudu/rpc/connection.h
M src/kudu/rpc/constants.cc
M src/kudu/rpc/inbound_call.cc
M src/kudu/rpc/inbound_call.h
M src/kudu/rpc/outbound_call.cc
M src/kudu/rpc/outbound_call.h
M src/kudu/rpc/rpc-test.cc
M src/kudu/rpc/rpc_header.proto
M src/kudu/rpc/serialization.cc
M src/kudu/rpc/serialization.h
M src/kudu/rpc/transfer.cc
M src/kudu/rpc/transfer.h
15 files changed, 328 insertions(+), 99 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/99/7599/1
-- 
To view, visit http://gerrit.cloudera.org:8080/7599
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5c8e294090279649082eebc4f6cfb6fe858bbbfc
Gerrit-PatchSet: 1
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Michael Ho <k...@cloudera.com>

Reply via email to