Skip to content

Commit

Permalink
Merge pull request #907 from drmingdrmer/44-loosen-check
Browse files Browse the repository at this point in the history
Chore: print first and last log id when unexpected logs are returned while replicating
  • Loading branch information
drmingdrmer authored Jul 29, 2023
2 parents 003b15d + e94cc46 commit 6ada312
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions openraft/src/replication/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ use crate::Instant;
use crate::LogId;
use crate::MessageSummary;
use crate::NodeId;
use crate::RaftLogId;
use crate::RaftTypeConfig;
use crate::StorageError;
use crate::StorageIOError;
Expand Down Expand Up @@ -294,10 +295,12 @@ where
debug_assert_eq!(
logs.len(),
(end - start) as usize,
"expect logs {}..{} but got only {} entries",
"expect logs {}..{} but got only {} entries, first: {}, last: {}",
start,
end,
logs.len()
logs.len(),
logs.first().map(|ent| ent.get_log_id()).display(),
logs.last().map(|ent| ent.get_log_id()).display()
);
logs
};
Expand Down

0 comments on commit 6ada312

Please sign in to comment.