Alon Bar-Lev has posted comments on this change.
Change subject: packaging: Added generic DB validations before the upgrade
......................................................................
Patch Set 14: Looks good to me, but someone else must approve
(2 inline comments)
Looks good!
....................................................
File backend/manager/tools/dbutils/fkvalidator.sh
Line 36: printf "\t-u USERNAME - The admin username for the database.\n"
Line 37: printf "\t-l LOGFILE - The logfile for capturing output
(def. ${LOGFILE})\n"
Line 38: printf "\t-f - Fix the non consistent data by removing
it from DB.\n"
Line 39: printf "\t-v - Turn on verbosity
(WARNING: lots of output)\n"
Line 40: printf "\t-q - Run in a batch mode (don't ask
questions) \n"
no space at eol
Line 41: printf "\t-h - This help text.\n"
Line 42: printf "\n"
Line 43: popd>/dev/null
Line 44: exit $ret
Line 57: local fix_it=${1}
Line 58: if [ "${fix_it}" = "true" ]; then
Line 59: CMD="copy (select fk_violation from
fn_db_validate_fks(${fix_it})) to stdout;"
Line 60: else
Line 61: CMD="copy (select fk_violation,fk_status from
fn_db_validate_fks(${fix_it}) where fk_status=1) to stdout with csv;"
Can be hardcoded instead of ${fix_it}, but not that important
Line 62: fi
Line 63: res="$(psql -w --pset=tuples_only=on --set ON_ERROR_STOP=1 -U
${USERNAME} -c "${CMD}" -h "${SERVERNAME}" -p "${PORT}" "${DATABASE}")"
Line 64: exit_code=$?
Line 65:
--
To view, visit http://gerrit.ovirt.org/12512
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Ief0e65231bb42b569734cdd2fa6491b645491f98
Gerrit-PatchSet: 14
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Alex Lourie <[email protected]>
Gerrit-Reviewer: Alex Lourie <[email protected]>
Gerrit-Reviewer: Alon Bar-Lev <[email protected]>
Gerrit-Reviewer: Juan Hernandez <[email protected]>
Gerrit-Reviewer: Moran Goldboim <[email protected]>
Gerrit-Reviewer: Ofer Schreiber <[email protected]>
Gerrit-Reviewer: Sandro Bonazzola <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches