erikgrinaker / toydb

Distributed SQL database in Rust, written as an educational project
Apache License 2.0
6.12k stars 564 forks source link

Unit test comment error #67

Closed Light-City closed 5 months ago

Light-City commented 5 months ago

follower last_index is 3, last_term is 2, so this should be the old index.

 fn step_solicitvote_last_index_outdated() -> Result<()> {
        let (follower, mut node_rx) = setup()?;
        let mut node = follower.step(Envelope {
            from: 3,
            to: 1,
            term: 3,
            message: Message::Campaign { last_index: 2, last_term: 2 },
        })?;
}

comment: SolicitVote is rejected if last_term is outdated.

so change last_term to last_index.