You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2021/01/12 12:29:53 UTC

[GitHub] [cloudstack] weizhouapache commented on pull request #4582: Upgrade: check systemvm template before db changes

weizhouapache commented on pull request #4582:
URL: https://github.com/apache/cloudstack/pull/4582#issuecomment-758624837


   > @ustcweizhou isn't the whole db upgrade path wrapped in a transaction? I suppose the whole transaction would fail without committing anything to the DB?
   
   @rhtyd 
   unfortunately no...
   In each upgrade, the transaction will be started, committed and finally closed.
   https://github.com/apache/cloudstack/blob/master/engine/schema/src/main/java/com/cloud/upgrade/DatabaseUpgradeChecker.java#L240-L310
   it is bad, but not the worst.
   
   new system template is checked in performMigration. Before that, sql in script will be committed
   (1) autocommit is true.
   in https://github.com/apache/cloudstack/blob/master/framework/db/src/main/java/com/cloud/utils/db/ScriptRunner.java#L148-L150
   (2) autocommit is false.
   https://github.com/apache/cloudstack/blob/master/framework/db/src/main/java/com/cloud/utils/db/ScriptRunner.java#L181-L183
   
   options are
   (1) check systemvm template at the beginning of whole upgrade, or
   (2) check systemvm template at each version upgrade.
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org