Description of problem: If there are ChangeMembersDomainOp pending operations it does not seem as if these are cleared. Version-Release number of selected component (if applicable): 2.2 How reproducible: Intermittent Steps to Reproduce: Unknown Actual results: see follow-up comment (as it contains sensitive information). Summary: # oo-admin-clear-pending-ops Failed to clear op for domain (DOMAIN) - #<ChangeMembersDomainOp _id: UUID, created_at: 2015-09-30 16:20:47 UTC, parent_op_id: nil, state: "init", queued_at: 0, completed_app_ids: nil, on_completion_method: nil, _type: "ChangeMembersDomainOp", members_added: nil, members_removed: [["UUID", "user"]], roles_changed: nil> ... 0 applications were cleaned up. 0 users were cleaned up. 1 domains were cleaned up. 0 teams were cleaned up. Expected results: The error thrown by (puts "Failed to clear op for domain (#{d.namespace}) - #{op.inspect} ") should not be seen (in the code below) as the operation should be deleted with ( dlist.each { |op| op.delete } or dlist.each { |op| op.delete }) Additional info: The workaround to this is to set the pending_ops for a domain to "[ ]" via mongo $domain_count = 0 def clean_domain(d) $domain_count += 1 d.reload dlist = d.pending_ops.select { |op| op._type.nil? } dlist.each { |op| op.delete } d.pending_ops.delete_if { |op| op.nil? } d.run_jobs rescue nil d.reload dlist = d.pending_ops.select { |op| op.completed? } dlist.each { |op| op.delete } d.pending_ops.each { |op| unless op.completed? puts "Failed to clear op for domain (#{d.namespace}) - #{op.inspect} " op.state = :queued if op.state == :init end } d.save! end
Commit pushed to master at https://github.com/openshift/origin-server https://github.com/openshift/origin-server/commit/8826681b7eca191934338dacebd819ef3dd84d74 Bug 1268080: Handling missing parent domain ops during app op execution
Thanks for your help. Get the expected result. Move it to VERIFIED.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHSA-2015-2666.html