-
Notifications
You must be signed in to change notification settings - Fork 1
Description
For example: see https://jirasul.stanford.edu/jira/browse/SDRO-282
TL;DR, two druids were stuck in the accessionWF, meaning that their status was "Accessioned" but they were still active in the workflow, with some steps showing a waiting status.
Trying to set the status of waiting steps to completed didn't work -- the steps remained in waiting.
Looking at the objects in the workflow database revealed that the objects had at least one, sometimes two records for each completed step. We were able to remediate the objects by deleting the duplicate completed steps, and the remaining waiting steps for the object, then re-indexing them. At that point, the objects had an "Accessioned" status and showed they had completed the workflow.
This is how we discovered and remediated the objects:
> WorkflowStep.where(druid: 'druid:yp120fy0284', workflow: 'accessionWF', status: 'completed', process: 'content-metadata').count
=> 1
> WorkflowStep.where(druid: 'druid:yp120fy0284', workflow: 'accessionWF', status: 'completed', process: 'start-accession').count
=> 2
> WorkflowStep.where(druid: 'druid:yp120fy0284', workflow: 'accessionWF', status: 'waiting').count
=> 10
> WorkflowStep.where(druid: 'druid:yp120fy0284', workflow: 'accessionWF', status: 'completed', process: 'start-accession').first.destroy
> WorkflowStep.where(druid: 'druid:yp120fy0284', workflow: 'accessionWF', status: 'waiting').each { |wfs| wfs.destroy }Presumably this would be a harder position to get into if the workflow service were unable to generate "duplicates" like these, whether duplicate records for a step at a given status, or across different statuses.