-
Notifications
You must be signed in to change notification settings - Fork 172
Enable removing bad subns anchors safely #799
Conversation
/hold until #788 is merged (both changed anchor validator and its unit test) |
Please hold review on this, I will let you know once it's ready. |
Hi @adrianludwin and @rjbez17, it's ready for review now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two small nits but otherwise lgtm.
Allow removing bad subns anchor if the subnamespace already exists and the parent doesn't match. The race condition could happen when two parents both create the same subns the same time and the webhook is bypassed because the forest is not updated after the first change. We would always allow resolving a bad state. Most importantly, make sure the subnamespace is not deleted with the deletion of a bad anchor. Before this change, the subnamespace created from a good anchor will also be deleted when deleting a bad anchor. Tested by test-issue-797-leaf.sh and test-issue-797-non-leaf.sh, where they disable the webhook first to generate the race condition in both a leaf and non-leaf subnamespace and enable the webhook to test the change. One unit test case is added to the anchor validator too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
/approve
/assign @rjbez17
/hold
Hi @adrianludwin , I also changed the ensuring of the subnamespace is not deleted by seeing the created secret is still there instead of matching the creatingTimestamp. |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: adrianludwin, rjbez17, yiqigao217 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Allow removing bad subns anchor if the subnamespace already exists and
the parent doesn't match. The race condition could happen when two
parents both create the same subns the same time and the webhook is
bypassed because the forest is not updated after the first change. We
would always allow resolving a bad state.
Most importantly, make sure the subnamespace is not deleted with the
deletion of a bad anchor. Before this change, the subnamespace created
from a good anchor will also be deleted when deleting a bad anchor.
Tested by test-issue-797-leaf.sh and test-issue-797-non-leaf.sh, where
they disable the webhook first to generate the race condition in both a
leaf and non-leaf subnamespace and enable the webhook to test the
change. One unit test case is added to the anchor validator too.
Fixes #797