cloudstack-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <>
Subject [jira] [Commented] (CLOUDSTACK-10278) Adding a SQL table column is not Idempotent
Date Fri, 16 Feb 2018 09:12:00 GMT


ASF GitHub Bot commented on CLOUDSTACK-10278:

ernjvr commented on a change in pull request #2449: WIP CLOUDSTACK-10278 idempotent column

 File path: engine/schema/resources/META-INF/db/schema-41000to41100.sql
 @@ -19,8 +19,54 @@
 -- Schema upgrade from to
+-- Stored procedure to do idempotent column add;
 Review comment:
   @rafaelweingartner yes, we will have to make sure that everyone creating new scripts to
add a new column, drop a foreign key or create/drop indexes, call these stored procedures,
to ensure their SQL statements are idempotent. 
   @rhtyd These 'drop procedure' statements are placed before each 'create procedure' statement
only. So when the upgrade script runs the procedures are created but not dropped after the
script completes. Therefore the stored procedures will still exist in the database. So they
will be available (reusable) to future versions of schema-nn-nn.sql migration scripts. I think
these 'drop/create procedure' statements also need to be added to the setup/db/create-schema.sql
script to make them available to new cs installs, including the simulator.

This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:

> Adding a SQL table column is not Idempotent
> -------------------------------------------
>                 Key: CLOUDSTACK-10278
>                 URL:
>             Project: CloudStack
>          Issue Type: Bug
>      Security Level: Public(Anyone can view this level - this is the default.) 
>          Components: Install and Setup
>    Affects Versions:,
>            Reporter: Ernie Janse van Rensburg
>            Assignee: Ernie Janse van Rensburg
>            Priority: Major
>   Original Estimate: 4h
>  Remaining Estimate: 4h
> The SQL code to add a new column to a table in the META-INF/db/schema-41000to41100.sql
script is not written in an idempotent way. When the upgrade is re-run, the code above causes
a SQL error as reported on the user mailing list: 
> ERROR [c.c.u.d.ScriptRunner] (main:null) (logid:)
> Error executing: ALTER TABLE cloud.network_offerings ADD COLUMN for_vpc
> This is a more generic problem for every version due to to the fact that it is not idempotent

This message was sent by Atlassian JIRA

View raw message