Orphaned uploads of type vulnerability remediation on staging-ref
There are currently 83 uploads queued for sync on staging-ref's secondary Geo site.
All of the objects have model_type Vulnerabilities::Remediation. None of the corresponding model objects exist anymore.
In gdk, creating an instance of Vulnerabilities::Remediation correctly creates the corresponding upload object, registry entry, and syncs to the secondary. Calling destroy! on the instance removes the object, and the registry entry.
Manually running qa/specs/features/ee/browser_ui/10_govern/vulnerability_management_spec.rb against the GDK instance also does not leave the orphaned registry entry.
irb(main):006:0> uploads = Geo::UploadRegistry.where(state: 1)
=>
[#<Geo::UploadRegistry:0x00007faec848a1b0
...
irb(main):007:0> uploads.size
=> 83
irb(main):013:0> uploads.collect(&:last_sync_failure).uniq
=> ["Sync timed out after 28800"]
irb(main):019:0> uploads.collect(&:upload).collect(&:model_type).uniq
=> ["Vulnerabilities::Remediation"]
irb(main):021:0> uploads.collect(&:upload).collect(&:model_id).size
=> 83
irb(main):022:0> Vulnerabilities::Remediation.find_each.size
=> 1
irb(main):025:0> uploads.collect(&:upload).collect(&:model_id).include?(Vulnerabilities::Remediation.find_each.first.id)
=> false
Edited by Michael Kozono