If an older peer sends an uncommitted value, make sure we only take it
if it is in the future, and at least as new as any current uncommitted
value.
(Prior to the previous patch, peers could send values from long-past
rounds. The pn values are also bogus.)
Signed-off-by: Sage Weil <sage@inktank.com>
// did this person send back an accepted but uncommitted value?
if (last->uncommitted_pn &&
- last->uncommitted_pn > uncommitted_pn) {
+ last->uncommitted_pn > uncommitted_pn &&
+ last->last_committed >= last_committed &&
+ last->last_committed + 1 >= uncommitted_v) {
uncommitted_v = last->last_committed+1;
uncommitted_pn = last->uncommitted_pn;
uncommitted_value = last->values[uncommitted_v];