Alexey Serbin has posted comments on this change.

Change subject: [KuduPartialRow::Set{Binary,String}()] copy input data

Patch Set 1:

Commit Message:

Line 17: This is safe, but an incompatible change, but we don't bump
> Code will still link / compile so this isn't API or ABI compatible. It's ju
File src/kudu/common/partial_row.h:

Line 108:   // must remain valid until data for corresponding RPC calls are 
> Isn't the rule that the data must remain valid until the corresponding RPC 
Thank you for bringing in this question -- I decided to look around to clarify 
on this.

As I see from the code, the slice's data is encoded into PB packet before 
issuing corresponding RPC call (see RowOperationsPBEncoder::Add() in  So, if talking about when it's save to release the data 
which is necessary to make corresponding RPC call, then it's about waiting for 
data to be encoded into the PB packet, not sending the request and awaiting for 

However, if an error happened, then the error information returned by 
KuduSession::GetPendingErrors() refers to the original KuduWriteOperation 
object, which in its turn refers to KuduPartialRow object.  The KuduPartialRow 
object refers to its slice objects, and the corresponding slice objects refers 
to our binary/string data.  So, if an error happened and somebody is to analyze 
the error, the slice data should be kept alive till the end of the call.

In other words, you are right -- to be sure to have safe access the data 
corresponding to errors, if any, it's necessary to keep that data around until 
completion of the corresponding RPC calls.

I will update the comment.

To view, visit
To unsubscribe, visit

Gerrit-MessageType: comment
Gerrit-Change-Id: I764339a0e3ffbf6abd5372e682c9fa1792bdd52b
Gerrit-PatchSet: 1
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Alexey Serbin <>
Gerrit-Reviewer: Alexey Serbin <>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Mike Percy <>
Gerrit-HasComments: Yes

Reply via email to