Skip to content

Commit

Permalink
fix snapshot
Browse files Browse the repository at this point in the history
Signed-off-by: Connor1996 <[email protected]>
  • Loading branch information
Connor1996 committed Sep 12, 2023
1 parent 5a955f8 commit cef9add
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/env/hedged.rs
Original file line number Diff line number Diff line change
Expand Up @@ -317,10 +317,10 @@ impl HedgedSender {
};
match inner.state {
RecoveryState::Paused1 => {
inner.disk1.send((task, cb)).unwrap();
inner.disk2.send((task, cb)).unwrap();
}
RecoveryState::Paused2 => {
inner.disk2.send((task, cb)).unwrap();
inner.disk1.send((task, cb)).unwrap();
}
_ => unreachable!(),
}
Expand Down Expand Up @@ -432,13 +432,15 @@ impl TaskRunner {
assert_ne!(seq, 0);
if let Some(snap) = snap_seq.as_ref() {
// the change already included in the snapshot
if seq + 1 < *snap {
} else if seq + 1 == *snap {
if seq < *snap {
continue;
} else if seq == *snap {
unreachable!();
} else if seq == *snap + 1 {
snap_seq = None;
} else {
panic!("seqno {} is larger than snapshot seqno {}", seq, *snap);
}
continue;
}

assert_eq!(last_seq + 1, seq);
Expand Down

0 comments on commit cef9add

Please sign in to comment.