Change the way activations are deleted when a system is deleted #1332
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.
Description
There is no need to run validations for activations or to instantiate all the activations objects from the DB when destroying a system
Changing
:destroyto:delete_allreduce the DB queries considerably, while keeping consistency with regsharing (unaffected)current queries for deleting a system
if we apply this change
Implications or side effects:
Registration sharing:
Non issue,
CASE A:
if both update infrastructure servers are on the same version, meaning having this change of queries
when deleting the system will trigger a registration sharing on the sibling, the sibling will destroy the sibling and produce the same 2 queries
removing activation does not change behaviour
when an activation is deleted in one update server, the destruction of that activation is still propagated on regsharing
CASE B:
if sibling 1 has the feature and sibling 2 has the multiple queries for activations (destroy on dependency),
when deleting the system on the server with the new feature will trigger the destruction of the system on the server without the feature and nothing will have changed for
that operation on the sibling without the feature
same the other way around, if server without the feature removes a system will trigger the destruction of the system on regsharing for the sibling with the new feature,
producing only 2 queries (if the system had any activation, that is)
removing activation does not change behaviour
**Callbacks (includes regsharing call)*:
CASE A:
trigger DeregisteredSystem.find_or_create_by system.scc_system_id does not change behaviour as it depends on system destroy call, which is still in place
CASE B:
triggering DeregisteredSystem.find_or_create_by system.scc_system_id does not change behaviour as it depends on system destroy call, which is still in place
How to test
Running
registercloudguest --cleanon the client should change nothing on the behaviour and operations in the update infrastructure server:of the systems should get removed in the siblings
Change Type
Please select the correct option.
Checklist
Please check off each item if the requirement is met.
MANUAL.mdfile with any changes to the user experience.package/obs/rmt-server.changes.Review
Please check out our review guidelines
and get in touch with the author to get a shared understanding of the change.