Repository navigation
Make all Conditions positive terminating conditions - #733
Conversation
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: evankanderson The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
…so re-add the "IsFailed" condition, keying off of non-Ready conditions on the revision.
mattmoor
left a comment
There was a problem hiding this comment.
This is looking really good, thanks for putting this together.
There was a problem hiding this comment.
I think what we discussed offline made the above an even stronger statement.
Where it makes sense, resources should define a "Ready" condition that indicates
the status of reconciliation. Clients should not need to look at any other conditions
to determine the state of the resource.
There was a problem hiding this comment.
at a minimum, the above has several typos:
- "happy state" resource => "happy state" condition or type
- "resourc"
There was a problem hiding this comment.
Thinking about how this works for Build, "Ready" seems like an odd name.
I think the nuance is that services that should stay up, should use "Ready", but run-to-completion pods should probably bias towards a different name. WDYT?
There was a problem hiding this comment.
I favor allowing two canonical names, one for "run to completion" resources like Build, one for persistently-going resources like Revision: "Succeeded" and "Ready"
There was a problem hiding this comment.
Naomi beat me to the punch on naming.
There was a problem hiding this comment.
We should probably split this into two parts
- Talk about interpreting "Status: Foo"
- Talk about Reason/Message
For the former, I think you overly qualify "terminal". I think we should have something like:
Each condition's status will be one of:
- "Unknown" when the controller is actively working to achieve the condition Type's state.
- "False" when the reconciliation has failed.
- "True" when the reconcilitation has succeeded.
Type names will be chosen such that these interpretations are clear, e.g.
BuildSucceeded works because True = Success and False = Failure BuildCompleted does not because False could just mean "in-progress"For the special "Ready" condition, Unknown is the indicator of "in progress", and
True/False indicate that the overall reconciliation is complete (in error, if False)
For the latter, I think we essentially want what you have, with a few tweaks:
- Conditions with a status of False will also supply details about the failure in the
"Reason" and "Message" fields -- both of these should be considered to have
unlimited cardinality, unlike Type. If a resource has a "Ready" type, it will surface
the "Reason" and "Message" from the first failing sub Condition.
There was a problem hiding this comment.
Something else we discussed was allowing the elision of conditions with status True, if it's presence isn't useful / informative. I haven't seen that called out, but maybe I missed it.
There was a problem hiding this comment.
I don't like eliding conditions with status True, because I want to be able to present green checkmarks in the client when each step of deploying a revision succeeds, even if the whole revision is not ready yet.
There was a problem hiding this comment.
What about eliding the other conditions when the revision becomes Ready?
There was a problem hiding this comment.
(meta-comment, we can open an issue to track this, since it's a bigger unrelated change)
I think we should restructure this doc to follow the resource hierarchy a bit more. I'd like a place where we can enumerate the Condition Types, and call out whether a resource has the "happy path" Type.
I'm commenting here mainly because Configuration won't have such a Type.
There was a problem hiding this comment.
Yes -- I think this is something I'd like @labadav to help with the information architecture. This was originally a 40+ page doc, so I cut it on the existing sections, but those are probably not correct, and we should probably have some sort of table of contents and forward/back linkages.
There was a problem hiding this comment.
I think the rollout here is vestigial.
There was a problem hiding this comment.
I'm not sure I understand why we'd clear latestReadyRevisionName if the "most recent .... Revision is deleted", assuming it is not also the "most recently ready Revision". Can we update this wording?
There was a problem hiding this comment.
Updated; I'd combined two cases here.
There was a problem hiding this comment.
I would expect that clients would just need to look at Ready = False, but if we're using this to populate Ready's status, then perhaps we should key off of any condition with a status of False.
I guess this is a long way of saying: let's just remove the "Ready" exclusion?
There was a problem hiding this comment.
"All success conditions"
Also as noted above it should be an error to have Ready=True while some other success condition is False. The converse is not implied -- Ready can be False even if all other success conditions are True, so it certainly shouldn't be excluded from IsFailed
There was a problem hiding this comment.
We're using "IsFailed" to determine whether we need to do further reconciliation of the Revision. For the case where inactive revisions are marked Ready = False (Reason = Inactive), I didn't want "IsFailed" to return true.
There was a problem hiding this comment.
This case should return true, true
There was a problem hiding this comment.
lol, how did I miss that?
Do we have an "always fails" build? I supposed I can use one of the samples and point at a non-existent branch.
There was a problem hiding this comment.
In the build repo two of the conformance test builds intentionally fail. One by simply running the false command. The other is a test that if the process panics that the messages end up in our logs.
There was a problem hiding this comment.
Hmm, I have an idea :)
Seems like given the conventions we have outlined that we could automatically manage the "Ready" Condition via calls to SetCondition. This would make it much harder to run afoul of our guidelines, WDYT?
There was a problem hiding this comment.
Do we want to leave out cases where we are not Ready but all else is green?
There was a problem hiding this comment.
I'd like to get this PR in and then refactor, but that seems likely.
Do you want me to add a TODO?
There was a problem hiding this comment.
I think @mattmoor is suggesting that SetCondition() with a status of false could also populate the Ready condition automatically.
There was a problem hiding this comment.
Hmm, this seems to be fairly widespread...
There was a problem hiding this comment.
I think the goal in the test is to avoid re-using the constants from the other file, and instead show things closer to the user PoV.
There was a problem hiding this comment.
If I'm not mistaken this is supposed to be ContainerDeadlineExceeded?
There was a problem hiding this comment.
Oh look, we implemented something different than the spec. Thanks!
There was a problem hiding this comment.
Hmm, it appears that we pass through ExceededReadinessChecks from the underlying Deployment. (See revision.go, line 458)
sixolet
left a comment
There was a problem hiding this comment.
I think the biggest change I have is to talk about "success conditions", where the only "terminal conditions" are Ready (or also maybe Succeeded)
There was a problem hiding this comment.
Each resource should define a small number of success condition Types. I like calling these "success conditions" rather than "terminal conditions", because that's more descriptive of what they are. Ready/Succeeded are the only ones that really feel "terminal" to me.
There was a problem hiding this comment.
I described these as "success conditions" and "progress categories" -- thanks for calling this out.
There was a problem hiding this comment.
Thanks, directed this towards success instead of failure. This is what happens when I copy text quickly from one PR to another while carrying on a conversation.
There was a problem hiding this comment.
s/resource/condition type/
There was a problem hiding this comment.
I favor allowing two canonical names, one for "run to completion" resources like Build, one for persistently-going resources like Revision: "Succeeded" and "Ready"
There was a problem hiding this comment.
"All success conditions"
Also as noted above it should be an error to have Ready=True while some other success condition is False. The converse is not implied -- Ready can be False even if all other success conditions are True, so it certainly shouldn't be excluded from IsFailed
There was a problem hiding this comment.
I don't like eliding conditions with status True, because I want to be able to present green checkmarks in the client when each step of deploying a revision succeeds, even if the whole revision is not ready yet.
There was a problem hiding this comment.
type: Succeeded
status: False
There was a problem hiding this comment.
We haven't tackled build.elafros.dev yet. (Since that's in a separate repo.)
I'll add it to the TODO list.
There was a problem hiding this comment.
When the lack of Ready-ness is caused by a different success condition being False, the reason and message of Ready SHOULD match the condition that caused the failure.
There was a problem hiding this comment.
Addressed on line 58 in the general guidance.
There was a problem hiding this comment.
Do we want to leave out cases where we are not Ready but all else is green?
evankanderson
left a comment
There was a problem hiding this comment.
Thanks for the comments, I think I've addressed all of them.
I want to add one more test for my "Build failed, progress the world" bug, but PTAL.
There was a problem hiding this comment.
Naomi beat me to the punch on naming.
There was a problem hiding this comment.
Yes -- I think this is something I'd like @labadav to help with the information architecture. This was originally a 40+ page doc, so I cut it on the existing sections, but those are probably not correct, and we should probably have some sort of table of contents and forward/back linkages.
There was a problem hiding this comment.
Updated; I'd combined two cases here.
There was a problem hiding this comment.
I think we'd previously copied the name from Deployment (which has other moving parts involved), but I'm happy to change it back.
There was a problem hiding this comment.
What about eliding the other conditions when the revision becomes Ready?
There was a problem hiding this comment.
We haven't tackled build.elafros.dev yet. (Since that's in a separate repo.)
I'll add it to the TODO list.
There was a problem hiding this comment.
Addressed on line 58 in the general guidance.
There was a problem hiding this comment.
I think @mattmoor is suggesting that SetCondition() with a status of false could also populate the Ready condition automatically.
There was a problem hiding this comment.
I think I am ok with this. It's still a little odd: a very quick deploy is going to skip showing intermediate steps, whereas a slower one will show intermediate steps. That inconsistent behavior is in line with a reasonable user experience, though -- it's only longer-running operations where you care about watching the sub-steps.
PS there's a spelling error on line 51
There was a problem hiding this comment.
I think our expectation is that higher-level UX will be more common than kubectl describe, so I'm open to leaving in transition conditions (even once complete) if we think it will meaningfully improve things.
There was a problem hiding this comment.
Removed this guidance (which I hadn't implemented yet, anyway).
There was a problem hiding this comment.
I think our expectation is that higher-level UX will be more common than kubectl describe, so I'm open to leaving in transition conditions (even once complete) if we think it will meaningfully improve things.
There was a problem hiding this comment.
nit: Condition (drop plural)
There was a problem hiding this comment.
tl;dr I think LatestRevisionReady may be a misnomer.
Suppose: LastestCreatedRevisionName == LatestReadyRevisionName
Question: If this revision were to reach Ready = False (vs. being deleted) I assume (based on the name) that we would also make the configuration's LatestRevisionReady condition False, right?
However, what if the reason for this is that the named revision is put into ServingState = Reserve, which I believe should set the revision's Ready condition to False, and cascade as you outline.
I'll propose LatestRevisionAvailable as an alternative, since it may not be Ready, but it is available to make Reserve => Active and become Ready. WDYT?
There was a problem hiding this comment.
Can we defer this to another issue?
I think there's probably an interesting state machine -- my short answer would be that LatestReadyRevisionName should "latch" when a Revision becomes ready, so that pointing a Route at the Configuration will activate the Revision, even if it's Ready = False at the moment.
Note that this is covering the Revision being deleted, not marked as not Ready (so the cascade I outlined wouldn't apply). On the other hand, I'm happy to change the name if we find a better name.
There was a problem hiding this comment.
reason should be considered a terminal condition
nit: reasons aren't conditions :)
There was a problem hiding this comment.
This is a complete parenthesized sentence. (Which means that a period inside the parenthesis is correct.)
https://english.stackexchange.com/questions/13528/where-to-put-the-periods-when-using-a-parenthetical-sentence
https://www.grammarbook.com/punctuation/parens.asp
There was a problem hiding this comment.
In the build repo two of the conformance test builds intentionally fail. One by simply running the false command. The other is a test that if the process panics that the messages end up in our logs.
|
cc @imjasonh since we should adopt these conventions for Build as well. |
|
Updated, including test. |
|
/retest |
1 similar comment
|
/retest |
|
|
|
ahem now that I've actually updated my cluster, @evankanderson it looks like the test failure you're seeing now is b/c the conformance tests need an update: |
|
Hey look, that was handy! I found out that my dev machine was slightly broken, and I got to learn about how the conformance tests work. /retest |
|
/assign @bobcatfish (Also still need an |
|
/lgtm |
knative/operator@5636e31 includes autoscaler HA support so we can run e2e test against test/ha/autoscaler_test.go.
Fixes #351
Proposed Changes
Release Note
```Updates all Conditions to simplify client-side success/failure determination. Reconciliation now attempts to drive Conditions to a
Truestate for each type, with `False` state indicating either permanent failure (for Conditions other than `Ready') or inability to serve (for the `Ready` type).