Previously, pending operations failed to run and were added back to the job queue if the parent operation did not exist. When a parent operation was missing, child operations would never complete. This bug fix ensures that if a parent operation does not exist, the discrepancy is logged and the child operation moves on. As a result, if a parent operation is deleted or is otherwise missing, the remaining child operations are still be able to be completed.
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
Comment 14openshift-github-bot
2015-10-20 20:13:48 UTC
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
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