Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Entries might overflow the max_msg_size by batching #326

Open
Fullstop000 opened this issue Dec 5, 2019 · 2 comments
Open

Entries might overflow the max_msg_size by batching #326

Fullstop000 opened this issue Dec 5, 2019 · 2 comments

Comments

@Fullstop000
Copy link
Member

raft-rs/src/raft.rs

Lines 565 to 566 in f7f7d01

if self.batch_append && self.try_batching(to, pr, &mut ents) {
return;

try_batch doesn't check the entries size after batched which might cause the overflow.
Do we need to worry about this?

@hicqu @BusyJay

@hicqu
Copy link
Contributor

hicqu commented Dec 5, 2019

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.

@Fullstop000
Copy link
Member Author

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().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants