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

fix: used to panic when calling RaftStorage::entries with high=u64::MAX

parent 0625166f
No related branches found
No related tags found
1 merge request!1218return errors from governor to client
......@@ -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 mut ret = Vec::with_capacity(limit.min((high - low) as _));
let cap = limit.min((high - low) as _).min(4);
let mut ret = Vec::with_capacity(cap);
for tuple in iter {
let row = tuple.decode::<traft::Entry>()?;
......
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