This is an automated email from the ASF dual-hosted git repository. alexey pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/kudu.git
commit 57fb36a72261e1369dd9e5bc222676a0b860525e Author: Alexey Serbin <[email protected]> AuthorDate: Wed Feb 19 15:01:14 2025 -0800 [consensus] address warning on released replicates This patch addresses a warning that appeared after upgrading protobuf to version 3.21.9. Since the new protobuf marks some of the auto-generated methods with the [[nodiscard]] attribute, there was an extra warning that might have pointed to a possible memory leak. It wasn't the case because of the Log::AsyncAppendReplicates() method's semantics, but it's worth addressing it anyway. Change-Id: Ia756597b920622baef8c55b5040d6c051814db63 Reviewed-on: http://gerrit.cloudera.org:8080/22505 Tested-by: Alexey Serbin <[email protected]> Reviewed-by: Abhishek Chennaka <[email protected]> --- src/kudu/consensus/log.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/kudu/consensus/log.cc b/src/kudu/consensus/log.cc index 81d6f279a..422e6e771 100644 --- a/src/kudu/consensus/log.cc +++ b/src/kudu/consensus/log.cc @@ -872,7 +872,9 @@ Status Log::AsyncAppendReplicates(vector<ReplicateRefPtr> replicates, CreateBatchFromPB(REPLICATE, batch_pb, std::move(callback)); for (LogEntryPB& entry : *batch_pb.mutable_entry()) { - entry.release_replicate(); + // Release the ownership of ReplicateMsg in every entry since it's managed + // at the upper level where the 'replicates' parameter is passed from. + entry.unsafe_arena_release_replicate(); } return AsyncAppend(std::move(batch));
