Bug #17177

World invalidation can fail, when execution plans are missing

Added by Ivan Necas 7 months ago. Updated 3 months ago.

Status:Closed
Priority:Normal
Assigned To:Ivan Necas
Category:-
Target version:Foreman - Team Ivan Iteration 5
Difficulty: Bugzilla link:1390931
Found in release: Pull request:https://github.com/Dynflow/dynflow/pull/206
Story points-
Velocity based estimate-

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1390931
Description of problem:
Under some circumstances (such as manually deleting data from dynflow_execution_plan),

Version-Release number of selected component (if applicable):

How reproducible:
under special circumstances

Steps to Reproduce:
1. trigger a task
2. while the task is runnint, delete data from dynflow manually (CAUTION: THIS IS BY NO MEANS A RECOMMENDED WAY OF DEALING WITH TASKS - FOR REPRODUCER PURPOSES ONLY):
psql foreman
delete from foreman_tasks_tasks;
delete from foreman_tasks_locks;
delete from dynflow_steps;
delete from dynflow_actions;
delete from dynflow_execution_plans
exit
3. force kill the dynflow executor process
4. restart the foreman-tasks service

Actual results:
in logs, there is invalid worlds found message, where at the terminated world uuid, there ie "searching: 'execution_plan by: {:uuid=>\"'..."
the world
/foreman_tasks/dynflow/worlds still shows the world in the list

Expected results:
dynlfow is able to handle this situation, by skipping the deleted plans


Related issues

Related to foreman-tasks - Bug #15729: duplicate key value violates unique constraint "dynflow_c... Closed 07/19/2016
Copied to foreman-tasks - Bug #19146: World invalidation can fail, when execution plans are inv... Closed 11/02/2016

History

#1 Updated by Ivan Necas 7 months ago

  • Subject changed from World invalidation can fail, when execution plans are missing to World invalidation can fail, when execution plans are missing
  • Status changed from New to Ready For Testing
  • Target version set to Team Ivan Iteration 5
  • Pull request https://github.com/Dynflow/dynflow/pull/206 added

#2 Updated by Adam Ruzicka 7 months ago

  • Status changed from Ready For Testing to Closed
  • Assigned To set to Ivan Necas

#3 Updated by Ivan Necas 3 months ago

Note on cleanup with older versions that don't have the fix:

cat <<EOF | foreman-rake console
w = ForemanTasks.dynflow.world
w.coordinator.find_locks(class: Dynflow::Coordinator::ExecutionLock.name).each do |l|
exists = w.persistence.load_execution_plan(l.execution_plan_id) rescue nil
unless exists
puts "#{l.execution_plan_id} doesn't exist: deleting the lock"
w.coordinator.delete_record(l)
end
end; puts "finished"
EOF

#4 Updated by Ivan Necas 3 months ago

  • Related to Bug #15729: duplicate key value violates unique constraint "dynflow_coordinator_records_pkey" added

#5 Updated by Ivan Necas about 1 month ago

  • Copied to Bug #19146: World invalidation can fail, when execution plans are invalid added

Also available in: Atom PDF