openraft icon indicating copy to clipboard operation
openraft copied to clipboard

AppendEntriesResponse should be an enum of the returned state.

Open drmingdrmer opened this issue 3 years ago • 2 comments

Currently AppendEntriesResponse is:

pub struct AppendEntriesResponse {
    pub vote: Vote,
    pub success: bool,
    pub conflict: bool,
}

The leader has to check if a combination of these three fields is valid. E.g. success == true && conflict == true is an invalid combination.

It's better be a enum like:

pub enum AppendEntriesResponse {
    Ok,
    HigherVoteSeen(Vote),
    Conflict,
}

drmingdrmer avatar Feb 22 '22 12:02 drmingdrmer

👋 Thanks for opening this issue!

Get help or engage by:

  • /help : to print help messages.
  • /assignme : to assign this issue to you.

github-actions[bot] avatar Feb 22 '22 12:02 github-actions[bot]

/assignme

ygf11 avatar Feb 24 '22 11:02 ygf11

Any updates on this issue? It seems already solved by https://github.com/datafuselabs/openraft/pull/219.

cc @drmingdrmer

Xuanwo avatar Nov 02 '22 15:11 Xuanwo

Right. I forgot to close it. Thank you, my hero!

drmingdrmer avatar Nov 02 '22 16:11 drmingdrmer