Eli Mesika has uploaded a new change for review.

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:
datbase 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 
regulary
(you will not be able to run the original 03010250 directly without this change)

However, after 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 insures that 03010250 will be skipped and a comemnt will be inserted 
to the schema_verson table
(in a new comment columnh 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 <[email protected]>
---
M backend/manager/dbscripts/dbfunctions.sh
A 
backend/manager/dbscripts/upgrade/pre_upgrade/add_comment_col_to_schema_version.sql
2 files changed, 32 insertions(+), 13 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/69/4169/1
--
To view, visit http://gerrit.ovirt.org/4169
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id41a4b9406a9e60de783f779c9a51e5de7ce7676
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Eli Mesika <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to