-
Notifications
You must be signed in to change notification settings - Fork 102
Open
Labels
contributionThis PR is from a community contributor.This PR is from a community contributor.first-time-contributorIndicates that the PR was contributed by an external member and is a first-time contributor.Indicates that the PR was contributed by an external member and is a first-time contributor.
Description
Basically, engine.sync() creates an empty LogBatch and calls engine.write(). However, inside engine.write() there is an exit early if empty condition.
- Engine::sync creates an empty write batch here
/// Synchronizes the Raft engine.
pub fn sync(&self) -> Result<()> {
self.write(&mut LogBatch::default(), true)?;
Ok(())
}
- Inside Engine::write here is the check that if log batch is empty, return immediately
if log_batch.is_empty() {
return Ok(0);
}
Unless I'm missing something, engine.sync() is always a no-op and will hit that .is_empty() block every time.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
contributionThis PR is from a community contributor.This PR is from a community contributor.first-time-contributorIndicates that the PR was contributed by an external member and is a first-time contributor.Indicates that the PR was contributed by an external member and is a first-time contributor.