omnipaxos
omnipaxos copied to clipboard
Optimize resend of prepare and promise
Currently, a follower caches the promise message so that we can resend it upon timeout in case it gets dropped. However, the promise might contain log suffix or snapshot so it is wasteful to keep it in memory.
Since we can always recalculate the log suffix and/or snapshot that we should send to the leader in the promise, it is better to just cache the Prepare message.
Another optimization is to in the Prepare message include a flag that indicates whether the leader is interested in the suffix at all. In that case followers don't have to include the unnecessary suffix if we're already in the accept phase.