tikv / raft-rs

Raft distributed consensus algorithm implemented in Rust.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Clarification needed: processing ready state

rosik opened this issue · comments

Hi! I'm trying to understand the API in details, and need your help in figuring out valid use cases for the Ready state.

The doc states:

The returned Ready MUST be handled and subsequently passed back via advance or its families. Before that, DO NOT call any function like step, propose, campaign to change internal state.

But does the app HAVE TO call ready() if has_ready() == true? In other words, is it legal to call several step() and ignore a pending ready() for a while?

Thank you in advance.

commented

is it legal to call several step() and ignore a pending ready() for a while?

Yes, it's legal. It's part of the reason why designing ready interface that allowing batching up state changes and handle them at once.