raft-rs
raft-rs copied to clipboard
Entries might overflow the max_msg_size by batching
https://github.com/tikv/raft-rs/blob/f7f7d0121132ef6406b59fc774778285cd1477d6/src/raft.rs#L565-L566
try_batch
doesn't check the entries size after batched which might cause the overflow.
Do we need to worry about this?
@hicqu @BusyJay
It could cause some messages contain more entries than max_batch_size
. But I guess no overflow issue is introduced. I think the behavior needs to be changed.
Maybe we can just add utils::limit_size(after_batched_msg.entries, self.max_msg_size)
. But we still get some extra cost from the self.raft_log.entries()
.