diff --git a/conanfile.py b/conanfile.py index 577d3cf..e616576 100644 --- a/conanfile.py +++ b/conanfile.py @@ -10,7 +10,7 @@ class NuRaftMesgConan(ConanFile): name = "nuraft_mesg" - version = "3.6.4" + version = "3.7.0" homepage = "https://github.com/eBay/nuraft_mesg" description = "A gRPC service for NuRAFT" diff --git a/src/proto/proto_mesg_factory.cpp b/src/proto/proto_mesg_factory.cpp index 7fad1fb..1ba2116 100644 --- a/src/proto/proto_mesg_factory.cpp +++ b/src/proto/proto_mesg_factory.cpp @@ -338,6 +338,7 @@ inline std::shared_ptr< nuraft::resp_msg > toResponse(RaftMessage const& raft_ms auto const& resp = raft_msg.rc_response(); auto message = std::make_shared< grpc_resp >(base.term(), (nuraft::msg_type)base.type(), base.src(), base.dest(), resp.next_index(), resp.accepted()); + message->set_next_batch_size_hint_in_bytes(resp.batch_size_hint()); message->set_result_code((nuraft::cmd_result_code)(0 - resp.result_code())); if (nuraft::cmd_result_code::NOT_LEADER == message->get_result_code()) { LOGI("Leader has changed!"); diff --git a/src/proto/proto_service.cpp b/src/proto/proto_service.cpp index 843fe75..86beb6c 100644 --- a/src/proto/proto_service.cpp +++ b/src/proto/proto_service.cpp @@ -38,6 +38,7 @@ static RCResponse* fromRCResponse(nuraft::resp_msg& rcmsg) { auto req = new RCResponse; req->set_next_index(rcmsg.get_next_idx()); req->set_accepted(rcmsg.get_accepted()); + req->set_batch_size_hint(rcmsg.get_next_batch_size_hint_in_bytes()); req->set_result_code((ResultCode)(0 - rcmsg.get_result_code())); auto ctx = rcmsg.get_ctx(); if (ctx) { req->set_context(ctx->data(), ctx->size()); } diff --git a/src/proto/raft_types.proto b/src/proto/raft_types.proto index b6c6231..7779bb9 100644 --- a/src/proto/raft_types.proto +++ b/src/proto/raft_types.proto @@ -73,6 +73,7 @@ message RCResponse { bytes context = 3; string dest_addr = 4; ResultCode result_code = 5; + uint64 batch_size_hint = 6; } message RaftMessage {