add debug error if there is a partial apply and refresh index isn't set

This commit is contained in:
Alex Dadgar 2016-02-22 13:03:40 -08:00
parent 73f0ccb928
commit 0b65fb410a
1 changed files with 5 additions and 0 deletions

View File

@ -306,6 +306,11 @@ func evaluatePlan(pool *EvaluatePool, snap *state.StateSnapshot, plan *structs.P
mErr.Errors = append(mErr.Errors, err)
}
result.RefreshIndex = maxUint64(nodeIndex, allocIndex)
if result.RefreshIndex == 0 {
err := fmt.Errorf("partialCommit with RefreshIndex of 0 (%d node, %d alloc)", nodeIndex, allocIndex)
mErr.Errors = append(mErr.Errors, err)
}
}
return result, mErr.ErrorOrNil()
}