Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drop support for purge on delete #5677

Closed
sanderr opened this issue Mar 7, 2023 · 0 comments
Closed

drop support for purge on delete #5677

sanderr opened this issue Mar 7, 2023 · 0 comments
Assignees

Comments

@sanderr
Copy link
Contributor

sanderr commented Mar 7, 2023

Description

Completely drop support for purge on delete. If feasible, drop it from iso7 only but if it requires a lot of refactoring, delay the change for a few months to keep the branches closer together.

Original ticket description

incorrect dependency inversion for purge-on-delete

When the server receives a version and purge on delete is enabled, it inverts requires-provides edges for deleted resources and adds them to the model with purged=True. Under some circumstances the inversion logic is incorrect, leading to a circular dependency.

The source that does the inversion is part of the _put_version method in the orchestration service.

The inversion logic is as follows: it first collects all requires for the previous version of each deleted resource, then it empties each deleted resource's requires and provides. It then iterates over each of these resources, and for each requires that is part of the current model, it inverts it by instead adding the dependency to provides (if it's a cross-agent dependency) and adds this one as requires for the other one.

This is where it can go wrong: suppose a requires b, where a and b live on different agents and only a is deleted from the model. Then this logic goes through the following steps
a. empty a's requires and provides
b. leave b's requires and provides as is because it is not being purged
c. invert: set b.requires = a and a.provides = b
=> b still has b.provides = a, resulting in a circular (and incorrect) dependency. A similar issue occurs if the dependency would have been the other way around.

This issue was first reported here (linked for a reference to the discussion)

@sanderr sanderr added the bug Something isn't working label Mar 7, 2023
@sanderr sanderr removed the bug Something isn't working label Mar 7, 2023
@sanderr sanderr changed the title incorrect dependency inversion for purge-on-delete drop support for purge on delete Mar 7, 2023
@arnaudsjs arnaudsjs self-assigned this Apr 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants