Todd Lipcon has submitted this change and it was merged. ( 
http://gerrit.cloudera.org:8080/16136 )

Change subject: Enable arenas for RPC request and response
......................................................................

Enable arenas for RPC request and response

This changes the RPC server side to allocate a protobuf Arena for each
request. The request RPC and response are allocated from the Arena,
ensuring that any sub-messages, strings, repeated fields, etc, use that
Arena for allocation as well. Everything is deleted en-masse when the
InboundCall object (which owns the Arena) is destructed.

This is mostly a straight-forward change except for the change in
RaftConsensus. Specifically, we used to do a dirty const_cast to mutate
the inbound request and release the ReplicateMsgs, and move them into
the raft subsystem. When the request is allocated from an Arena, that
'release' is now actually making a copy, which broke the code path
there.

Given that there's now a copy happening nonetheless, I just made the
code more explicitly construct a new ReplicateMsg copying out of the
leader's request. There might be a slight performance degradation here
but seemed worth it for code clarity. My assumption here is that
anywhere that these copies are substantially expensive we'd probably be
disk-bound anyway.

Change-Id: I810931900fc2b5f1dec1265abadfb33fb41d29bf
Reviewed-on: http://gerrit.cloudera.org:8080/16136
Reviewed-by: Alexey Serbin <[email protected]>
Tested-by: Todd Lipcon <[email protected]>
---
M src/kudu/consensus/raft_consensus.cc
M src/kudu/consensus/raft_consensus.h
M src/kudu/rpc/inbound_call.h
M src/kudu/rpc/rpc_context.cc
M src/kudu/rpc/rpc_context.h
M src/kudu/rpc/service_if.cc
6 files changed, 25 insertions(+), 32 deletions(-)

Approvals:
  Alexey Serbin: Looks good to me, approved
  Todd Lipcon: Verified

--
To view, visit http://gerrit.cloudera.org:8080/16136
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I810931900fc2b5f1dec1265abadfb33fb41d29bf
Gerrit-Change-Number: 16136
Gerrit-PatchSet: 6
Gerrit-Owner: Todd Lipcon <[email protected]>
Gerrit-Reviewer: Alexey Serbin <[email protected]>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Tidy Bot (241)
Gerrit-Reviewer: Todd Lipcon <[email protected]>

Reply via email to