Skip to content
Snippets Groups Projects
Commit dc98913a authored by Georgy Moshkin's avatar Georgy Moshkin :speech_balloon:
Browse files

fix: bug in capacity calculations in RaftSpaceAccess::entries

parent ac21074d
No related branches found
No related tags found
1 merge request!1416feat: raft log auto compaction
......@@ -255,7 +255,8 @@ impl RaftSpaceAccess {
) -> tarantool::Result<Vec<traft::Entry>> {
let iter = self.space_raft_log.select(IteratorType::GE, &(low,))?;
let limit = limit.unwrap_or(usize::MAX);
let cap = limit.min((high - low) as _).min(4);
// Put a sane threshold on `cap` in case `high` is insanely big
let cap = limit.min((high - low) as _).min(1024);
let mut ret = Vec::with_capacity(cap);
for tuple in iter {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment