Reconcile rebuilds interrupted before replacement creation
This commit is contained in:
@@ -19,7 +19,10 @@ const unsettledDeployment = `d.state NOT IN ${terminal}
|
||||
OR EXISTS (SELECT 1 FROM restart_rollout r WHERE r.operation_id=d.id AND r.healthy_at IS NULL)
|
||||
OR EXISTS (SELECT 1 FROM native_provisioning n JOIN ec_host_operations a ON a.id IN (n.operation_id,n.stage_operation_id)
|
||||
LEFT JOIN native_instances i ON i.id=n.instance_id WHERE n.deployment_id=d.id AND
|
||||
(a.state NOT IN ('completed','failed') OR (a.id=n.operation_id AND a.state='completed' AND (
|
||||
(a.state NOT IN ('completed','failed')
|
||||
OR (a.state='failed' AND a.kind='instance.rebuild' AND a.id=n.operation_id
|
||||
AND json_type(a.result,'$.rebuildFailure') IS NOT NULL AND n.applied_at IS NULL)
|
||||
OR (a.id=n.operation_id AND a.state='completed' AND (
|
||||
(n.applied_at IS NULL AND COALESCE(json_array_length(n.files_json),0)>0)
|
||||
OR (d.action='destroy' AND i.retired_at IS NULL)
|
||||
OR (a.kind='instance.rebuild' AND i.retired_at IS NULL AND i.generation=n.generation)))))
|
||||
|
||||
Reference in New Issue
Block a user