Maor Lipchuk has uploaded a new change for review. Change subject: core: Update image statuses to OK on upgrade. ......................................................................
core: Update image statuses to OK on upgrade. Update statuses from LOCKED to OK only if no tasks exists, and use it on each upgrade with no specific flag. Change-Id: I31c6437ef4d757d9ec59ef93cb448735fc741a28 Signed-off-by: Maor Lipchuk <mlipc...@redhat.com> --- M backend/manager/dbscripts/delete_async_tasks_and_compensation_data.sql A backend/manager/dbscripts/upgrade/03_01_1540_update_locked_status_to_ok.sql 2 files changed, 5 insertions(+), 6 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/99/10699/1 diff --git a/backend/manager/dbscripts/delete_async_tasks_and_compensation_data.sql b/backend/manager/dbscripts/delete_async_tasks_and_compensation_data.sql index 438011c..925bd69 100644 --- a/backend/manager/dbscripts/delete_async_tasks_and_compensation_data.sql +++ b/backend/manager/dbscripts/delete_async_tasks_and_compensation_data.sql @@ -2,10 +2,4 @@ truncate table business_entity_snapshot; --- Change status from LOCKED to OK after upgrade since the tasks will be cancelled. -UPDATE images -SET imagestatus = 1 -WHERE imagestatus = 2; - - diff --git a/backend/manager/dbscripts/upgrade/03_01_1540_update_locked_status_to_ok.sql b/backend/manager/dbscripts/upgrade/03_01_1540_update_locked_status_to_ok.sql new file mode 100644 index 0000000..5a2213f --- /dev/null +++ b/backend/manager/dbscripts/upgrade/03_01_1540_update_locked_status_to_ok.sql @@ -0,0 +1,5 @@ +-- Change status from LOCKED to OK after upgrade when no tasks exists. +UPDATE images +SET imagestatus = 1 +WHERE imagestatus = 2 +AND NOT EXISTS (SELECT 1 from async_tasks); -- To view, visit http://gerrit.ovirt.org/10699 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I31c6437ef4d757d9ec59ef93cb448735fc741a28 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Maor Lipchuk <mlipc...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches