always check the CreateBeforeDestroy value from state#26263
Merged
Conversation
When there is only a destroy node, there is no descendent to check for "forced CBD", so we can only rely on the state to verify.
Correct the initial test state, and expand the test to cause a cycle without the previous fix.
Codecov Report
|
mildwonkey
reviewed
Sep 16, 2020
| n.destroyNode = d | ||
| } | ||
|
|
||
| // CreateBeforeDestroy checks this nodes config status and the status af any |
Contributor
There was a problem hiding this comment.
I think this comment is out of date now? It's no longer checking the companion destroy node?
mildwonkey
approved these changes
Sep 16, 2020
Contributor
mildwonkey
left a comment
There was a problem hiding this comment.
Looks reasonable to me (admittedly based more off your tests and explanation)! I left one tiny question about a comment; its not a blocker.
Remove the check for CreateBeforeDestroyOverride which can't happen in a destroy node. Remove the unnecessary GraphNodeAttachDestroyer interface, since we don't use it now that plans can record the create+destroy order.
a250b05 to
a6dffa8
Compare
|
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When destroying an instance which was forced to be
CreateBeforeDestroyfrom downstream consumers, we were inadvertently preferring the config value over the state value forCreateBeforeDestroy. TheCreateBeforeDestroyOverridewas not useful in this case, because a destroy node does not have the same descendants as the plan node, and we cannot check for a forcedCreateBeforeDestroyin the same manner, so we need to trust the value from state.The last commit is extra cleanup of some unnecessary interfaces, and is not going to be part of the backport candidate.
This fixes the cycle in #26226, and converts it into a duplicate of #25631.