Change in ovirt-engine[master]: core: db - prevent installing same script content twice

emesika at redhat.com emesika at redhat.com
Mon May 14 06:51:23 UTC 2012


Eli Mesika has submitted this change and it was merged.

Change subject: core: db - prevent installing same script content twice
......................................................................


core: db - prevent installing same script content twice

This patch should resolve the following scenario:
Example:
database last installed script is 03010130
latest database version file in repository 03010250
There is a need to install 03010250 without the 03010140 - 03010240 scripts because
03010140 - 03010240 deals with new feature A and 03010250 deals with new feature B
and we currently want to skip feature A changes from some reason (stability, etc.)

The way to do that is to copy 03010250 file as 03010131 and run the upgrade regularly
(you will not be able to run the original 03010250 directly without this change)

However, later we want to take feature A and all latest scripts , we have again 03010250
Running it again may lead to an ERROR if we are lucky (since upgrade scrips are not reentrant)
or to data corruption in the worst case.

This patch ensure that 03010250 will be skipped and a comment will be inserted to the schema_verson table
(in a new comment column added to that table in the pre_upgrade step) saying that 03010250 state is SKIPPED
since it was already installed by 03010131.

The patch is based on checking the file md5 and comparing it to the md5 of installed scripts inside the
schema_version table.

Change-Id: Id41a4b9406a9e60de783f779c9a51e5de7ce7676
Signed-off-by: Eli Mesika <emesika at redhat.com>
---
M backend/manager/dbscripts/dbfunctions.sh
A backend/manager/dbscripts/upgrade/pre_upgrade/add_comment_col_to_schema_version.sql
2 files changed, 30 insertions(+), 11 deletions(-)

Approvals:
  Eli Mesika: Verified; Looks good to me, approved


--
To view, visit http://gerrit.ovirt.org/4169
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Id41a4b9406a9e60de783f779c9a51e5de7ce7676
Gerrit-PatchSet: 5
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Eli Mesika <emesika at redhat.com>
Gerrit-Reviewer: Allon Mureinik <amureini at redhat.com>
Gerrit-Reviewer: Eli Mesika <emesika at redhat.com>
Gerrit-Reviewer: Yair Zaslavsky <yzaslavs at redhat.com>



More information about the Engine-commits mailing list