ManageIQ / inventory_refresh

Apache License 2.0
1 stars 23 forks source link

Mark and sweep strategy for archival and deletion #43

Closed Ladas closed 5 years ago

Ladas commented 5 years ago

Allowing mark&sweep for archival and deletion

First we send parts, client needs to generate :refresh_state_uuid, :refresh_state_part_uuid. Where :refresh_state_uuid must be same for all the parts and :refresh_state_part_uuid. We do expect uuid format.

After all parts were sent we send :total_parts, which is integer marking how many parts we expect with refresh_state_uuid to identify to which full refresh this belongs to. And optionally :sweep_scope that allows us to do full refresh of just 1 or more inventory collection.

The sweeping waits until all parts were saved, then it deletes/archives all records that were not touched (we use :last_seen_on column for this)

agrare commented 5 years ago

@Ladas can you document how this works in the description?

miq-bot commented 5 years ago

This pull request is not mergeable. Please rebase and repush.

Ladas commented 5 years ago

@agrare yes, I'll comment it and clean it up next week.

Ladas commented 5 years ago

@agrare ok this is ready, description added

miq-bot commented 5 years ago

Checked commits https://github.com/Ladas/inventory_refresh/compare/c2792436bd4f3c16767fe8fc6cc4912484db8280~...da98a3ee59dca7d926e298fc3e85a5d53202afc9 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0 10 files checked, 0 offenses detected Everything looks fine. :star: