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 0effae10a2
commit 3cac3fd5c4

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()
}