-
Notifications
You must be signed in to change notification settings - Fork 897
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
Delete complement strategy for deleting top level entities using batches #15229
Delete complement strategy for deleting top level entities using batches #15229
Conversation
Marking as WIP because this PR depends on #15227 |
Allow all_manager_uuids to be serialized/deserialized
Adding :all_manager_uuids for complement deletion, used in batched targeted strategies.
Implement delete_complement method
Expose noop? method on InventoryCollection, being able to quickly check if the IC processing can be skipped. #Please enter the commit message for your changes. Lines starting
Check for noop before starting any work in IC. Helps to lower down the number of unnecessary queries.
Turn all foreign_keys to symbols, for consistent comparing.
Store skeletal_manager_uuids to optimize the where queries
Remove a wrong IC reference because it's self
Always return data with symbolized keys
a41d95a
to
be3ddac
Compare
@miq-bot remove_label wip |
Remove to_s since we want to compare symbols
Checked commits Ladas/manageiq@c8904ae~...f822325 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0 app/models/manager_refresh/save_collection/saver/base.rb
|
@miq-bot add_label enhancement |
@@ -155,12 +155,13 @@ def add_remaining_inventory_collections(defaults, options = {}) | |||
|
|||
def to_raw_data | |||
collections_data = collections.map do |key, collection| | |||
next if collection.data.blank? | |||
next if collection.data.blank? && collection.manager_uuids.blank? && collection.all_manager_uuids.nil? |
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.
Why .blank?
for manager_uuids
but .nil?
for all_manager_uuids?
? They both look like arrays...
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.
collection.all_manager_uuids = [] will delete everything and nil is ignored
collection.manager_uuids [] or nil is equivalent, it should be marking that the collection will not be saving any data.
Depends on:
:delete_complement strategy for deleting top level entities using batch saving